W3C

XML Schema Part 2: Datatypes

W3C Working Draft 25 February 2000

This version:
http://www.w3.org/TR/2000/WD-xmlschema-2-20000225/
(in XML and HTML, with a schema and DTD for datatype definitions, as well as a schema for built-in datatypes only.)
Latest version:
http://www.w3.org/TR/xmlschema-2/
Previous versions:
http://www.w3.org/TR/1999/WD-xmlschema-2-19991217/
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-2000 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.

Following a 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 March, 2000, and to submit this specification thereafter 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".

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 Facets
        2.4.1 Fundamental facets
            2.4.1.1 Equal
            2.4.1.2 Order
            2.4.1.3 Bounds
            2.4.1.4 Cardinality
            2.4.1.5 Numeric
        2.4.2 Constraining or Non-fundamental facets
            2.4.2.1 length
            2.4.2.2 minlength
            2.4.2.3 maxlength
            2.4.2.4 pattern
            2.4.2.5 enumeration
            2.4.2.6 maxInclusive
            2.4.2.7 maxExclusive
            2.4.2.8 minInclusive
            2.4.2.9 minExclusive
            2.4.2.10 precision
            2.4.2.11 scale
            2.4.2.12 encoding
            2.4.2.13 period
    2.5 Datatype dichotomies
        2.5.1 Atomic vs. list datatypes
            2.5.1.1 Atomic datatypes
            2.5.1.2 List datatypes
        2.5.2 Primitive vs. derived datatypes
        2.5.3 Built-in vs. user-derived datatypes
3 Built-in datatypes
    3.1 Namespace considerations
    3.2 Primitive datatypes
        3.2.1 string
            3.2.1.1 Constraining facets
            3.2.1.2 Derived datatypes
        3.2.2 boolean
            3.2.2.1 Lexical Representation
            3.2.2.2 Constraining facets
        3.2.3 float
            3.2.3.1 Lexical representation
            3.2.3.2 Constraining facets
        3.2.4 double
            3.2.4.1 Lexical representation
            3.2.4.2 Constraining facets
        3.2.5 decimal
            3.2.5.1 Lexical representation
            3.2.5.2 Constraining facets
            3.2.5.3 Derived datatypes
        3.2.6 timeInstant
            3.2.6.1 Lexical Representation
            3.2.6.2 Constraining facets
        3.2.7 timeDuration
            3.2.7.1 Lexical Representation
            3.2.7.2 Constraining facets
        3.2.8 recurringInstant
            3.2.8.1 Lexical Representation
            3.2.8.2 Constraining facets
            3.2.8.3 Derived datatypes
        3.2.9 binary
            3.2.9.1 Constraining facets
        3.2.10 uri-reference
            3.2.10.1 Lexical representation
            3.2.10.2 Constraining facets
        3.2.11 ID
            3.2.11.1 Constraining facets
        3.2.12 IDREF
            3.2.12.1 Constraining facets
            3.2.12.2 Derived datatypes
        3.2.13 ENTITY
            3.2.13.1 Constraining facets
            3.2.13.2 Derived datatypes
        3.2.14 NOTATION
            3.2.14.1 Constraining facets
    3.3 Derived datatypes
        3.3.1 language
            3.3.1.1 Constraining facets
        3.3.2 IDREFS
            3.3.2.1 Constraining facets
        3.3.3 ENTITIES
            3.3.3.1 Constraining facets
        3.3.4 NMTOKEN
            3.3.4.1 Constraining facets
            3.3.4.2 Derived datatypes
        3.3.5 NMTOKENS
            3.3.5.1 Constraining facets
        3.3.6 Name
            3.3.6.1 Constraining facets
            3.3.6.2 Derived datatypes
        3.3.7 QName
            3.3.7.1 Constraining facets
        3.3.8 NCName
            3.3.8.1 Constraining facets
        3.3.9 integer
            3.3.9.1 Lexical representation
            3.3.9.2 Constraining facets
            3.3.9.3 Derived datatypes
        3.3.10 non-positive-integer
            3.3.10.1 Lexical representation
            3.3.10.2 Constraining facets
            3.3.10.3 Derived datatypes
        3.3.11 negative-integer
            3.3.11.1 Lexical representation
            3.3.11.2 Constraining facets
        3.3.12 long
            3.3.12.1 Lexical representation
            3.3.12.2 Constraining facets
            3.3.12.3 Derived datatypes
        3.3.13 int
            3.3.13.1 Lexical representation
            3.3.13.2 Constraining facets
            3.3.13.3 Derived datatypes
        3.3.14 short
            3.3.14.1 Lexical representation
            3.3.14.2 Constraining facets
            3.3.14.3 Derived datatypes
        3.3.15 byte
            3.3.15.1 Lexical representation
            3.3.15.2 Constraining facets
        3.3.16 non-negative-integer
            3.3.16.1 Lexical representation
            3.3.16.2 Constraining facets
            3.3.16.3 Derived datatypes
        3.3.17 unsigned-long
            3.3.17.1 Lexical representation
            3.3.17.2 Constraining facets
            3.3.17.3 Derived datatypes
        3.3.18 unsigned-int
            3.3.18.1 Lexical representation
            3.3.18.2 Constraining facets
            3.3.18.3 Derived datatypes
        3.3.19 unsigned-short
            3.3.19.1 Lexical representation
            3.3.19.2 Constraining facets
            3.3.19.3 Derived datatypes
        3.3.20 unsigned-byte
            3.3.20.1 Lexical representation
            3.3.20.2 Constraining facets
        3.3.21 positive-integer
            3.3.21.1 Lexical representation
            3.3.21.2 Constraining facets
        3.3.22 date
            3.3.22.1 Lexical Representation
            3.3.22.2 Constraining facets
        3.3.23 time
            3.3.23.1 Lexical Representation
            3.3.23.2 Constraining facets
4 Datatype components
    4.1 Datatype definition
    4.2 Constraining facets
        4.2.1 length
        4.2.2 minlength
        4.2.3 maxlength
        4.2.4 pattern
        4.2.5 enumeration
        4.2.6 maxInclusive
        4.2.7 maxExclusive
        4.2.8 minExclusive
        4.2.9 minInclusive
        4.2.10 precision
        4.2.11 scale
        4.2.12 encoding
        4.2.13 period
5 XML representation of datatype definitions
    5.1 Datatype Definitions
        5.1.1 Derivation by restriction
        5.1.2 Derivation by list
    5.2 Constraining facets
        5.2.1 length
        5.2.2 minlength
        5.2.3 maxlength
        5.2.4 pattern
        5.2.5 enumeration
        5.2.6 maxInclusive
        5.2.7 maxExclusive
        5.2.8 minInclusive
        5.2.9 minExclusive
        5.2.10 precision
        5.2.11 scale
        5.2.12 encoding
        5.2.13 period
6 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
    E.1 Character Classes
        E.1.1 Character Class Escapes
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 an 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].

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:

Ed. Note: The list below represents a merger of the equivlant sections from both structures and datatypes. Do we really need all of these terms defined in the datatypes spec?

[Definition:]   for compatibility
A feature of this specification included solely to ensure that schemas which use this feature remain compatible with [XML 1.0 Recommendation]
[Definition:]  may
Conforming documents and processors are permitted to but need not behave as described.
[Definition:]  match
(Of strings or names:) Two strings or names being compared must be character for character the same.
[Definition:]  identical
(Of URIs) identical, according to the rules for identity in [Namespaces in XML].
[Definition:]  must
Conforming documents and processors are required to behave as described; otherwise they are in error.
[Definition:]  error
A violation of the rules of this specification; results are undefined. Conforming software may detect and report an error and may recover from it.
[Definition:]  fatal error
An error which a conforming processor must detect and report to the application.

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 values for a given datatype. Each value in the value space of a datatype is denoted by one or more literals in its lexical space.

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. The properties of value spaces that are recognized by this specification are defined in Fundamental facets (§2.4.1).

2.3 Lexical space

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

[Definition:]  A lexical space is the set of valid literals for a datatype (literals may appear as one or more character information items as defined in [XML Information Set]).

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

2.4 Facets

[Definition:]  A facet is a single defining aspect of a value space. Generally speaking, each facet characterizes a value space along independent axes 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.4.1 Fundamental facets

A datatype is characterized by properties of its 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.4.1.1 Equal

Every value space supports the notion of equality, with the following rules:

  • for any two instances of values from the value space (a,b), either a is equal to b, denoted a = b, or a is not equal to b, denoted a != b;
  • there is no pair of instances (a, b) of values from the value space such that both a = b and a != b;
  • for every value a from the value space, a = a;
  • for any two instances (a, b) of values from the value space, a = b if and only if b = a;
  • for any three instances (a, b, c) of values from the value space, if a = b and b = c, then a = c.

On every datatype, the operation Equal is defined in terms of the equality property of the value space: for any values a, b drawn from the value space, Equal(a,b) is true if a = b, and false otherwise.

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

2.4.1.3 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, v <= U. [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, L <= v. [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.4.1.4 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:

2.4.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.4.2 Constraining or Non-fundamental facets

[Definition:]  A Constraining facet is an optional property 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 base type is described in Derivation by restriction (§5.1.1).

In this section we define all constraining facets that are available for use when defining derived datatypes.

2.4.2.1 length

[Definition:]  length is the number of units of length, where units of length varies depending on the base type. The value of length must be a non-negative-integer.

For datatypes derived from string, length is measured in units of characters. For datatypes derived from binary, length is measured in octets (8 bits). For datatypes derived by list, length is measured in list items.

2.4.2.2 minlength

[Definition:]  minlength is the minimum number of units of length, where units of length varies depending on the base type. The value of minlength must be a non-negative-integer.

For datatypes derived from string, minlength is measured in units of characters. For datatypes derived from binary, 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.
Constraint on Schemas: minlength <= maxlength
It is an error for the value specified for minlength to be greater than the value specified for maxlength for the same datatype.
2.4.2.3 maxlength

[Definition:]  maxlength is the maximum number of units of length, where units of length varies depending on the base type. The value of maxlength must be a non-negative-integer.

For datatypes derived from string, maxlength is measured in units of characters. For datatypes derived from binary, 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.4.2.4 pattern

[Definition:]   pattern is a constraint on the value space of a datatype which is achieved by constraining the lexical space. The value of pattern must be a regular expression.

2.4.2.5 enumeration

[Definition:]   enumeration constrains the value space to a specified set of values.

No order or any other relationship is implied between the individual items of the enumeration set.

2.4.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 base type.

Constraint on Schemas: minInclusive <= maxInclusive
It is an error for the value specified for minInclusive to be greater than the value specified for maxInclusive for the same datatype.
2.4.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 base type.

Constraint on Schemas: maxInclusive and maxExclusive
It is an error for both maxInclusive and maxExclusive to be specified for the same datatype.
Constraint on Schemas: minExclusive <= maxExclusive
It is an error for the value specified for minExclusive to be greater than the value specified for maxExclusive for the same datatype.
2.4.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 base type.

2.4.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 base type.

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

[Definition:]  precision is the total number of decimal digits in values of datatypes derived from decimal. The value of precision must be a positive-integer.

2.4.2.11 scale

[Definition:]  scale is the total number of decimal digits to the right of the decimal indicator in values of datatypes derived from decimal. The value of scale must be a non-negative-integer .

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

2.4.2.12 encoding

[Definition:]  encoding is the encoded form of the lexical space of datatypes derived from binary. The value of encoding must be one of {hex, base64}.

If the value of encoding is hex then each binary octect is encoded as a character tuple, consisting the two hexadecimal digits ([0-9a-fA-F]) representing the octet code. For example, "20" is the hex encoding for the US-ASCII space character.

If the value of encoding is base64 then the entire binary stream is encoding using the Base64 Content-Transfer-Encoding defined in Section 6.8 [RFC 2045].

2.4.2.13 period

[Definition:]  period is the frequency of recurrence for values of datatypes derived from recurringInstant. The value of period must be timeInstant.

2.5 Datatype dichotomies

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

2.5.1 Atomic vs. list datatypes

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

  • [Definition:]  Atomic datatypes are those having values which are regarded by this specification as being indivisible.
  • [Definition:]  List datatypes are those having values which consist of a sequence of values of an atomic datatype.

For example, a single token which matches Nmtoken from [XML 1.0 Recommendation] could be the value of an atomic datatype (NMTOKEN); while a sequence of such tokens could be the value of a list datatype (NMTOKENS).

2.5.1.1 Atomic datatypes

atomic datatypes may be either primitive or derived. The value space of an atomic datatype is a set of "atomic" values, which for the purposes of this specification, are not further decomposable. The lexical space of an atomic datatype is a set of literals whose internal structure is specific to the datatype is question.

2.5.1.2 List datatypes

list datatypes are always derived. The value space of a list datatype is a set of finite sequences of atomic values. The lexical space of a list datatype is a set of literals whose internal structure is a whitespace separated sequence of literals of the atomic datatype of the items in the list (where whitespace matches S in [XML 1.0 Recommendation]).

It is not an error to define a list datatype derived from an atomic datatype whose lexical space allows whitespace.

Example
<simpleType name='listOfString' base='string' derivedBy='list'/>
<someElement xsi:type='listOfString'>
this is not list item 1
this is not list item 2
this is not list item 3
</someElement>
In the above example, the value of the someElement element is not a list of length 3; rather, it is a list of length 18.

When a datatype is derived from a list datatype, the following constraining facets may be used:

For each of the above facets, the unit of length is measured in list items.

NOTE: A datatype which is atomic in this specification need not be an "atomic" datatype in any programming language used to implement this specification. Likewise,a datatype which is a list in this specification need not be a "list" datatype in any programming language used to implement this specification.

2.5.2 Primitive vs. derived datatypes

Next, we distinquish between primitive and derived datatypes.

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

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

The datatypes defined by this specification fall into both the primitive and derived 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 derived.

[Definition:]  Every derived datatype is defined in terms of an existing datatype, referred to as the base type. base types may be either primitive or derived.

In the example above, date is derived from the base type recurringInstant.

NOTE: 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 derived in this specification need not be a "derived" datatype in any programming language used to implement this specification.

2.5.3 Built-in vs. user-derived datatypes

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

NOTE: 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-derived in this specification need not be a "user-derived" datatype in any programming language used to implement this specification.

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 have the namespace URI:

This applies to both built-in primitive and built-in derived datatypes.

Each user-derived datatype is also associated with a unique namespace. However, user-derived datatypes do not come from the XML Datatype Language namespace; rather, they come from the namespace of the schema in which they are defined (see XML Representation of Schemas in [XML Schema Part 1: Structures]).

As described in more detail in Datatype Definitions (§5.1), each user-derived datatype must be defined in terms of another datatype in one of two ways: 1) by assigning constraining facets which serve to restrict the value space of the user-derived datatype to a subset of the base type; 2) by creating a list datatype whose value space consists of finite-length sequences of values of the base type.

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 and any datatypes derived from this the datatype 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.2 Derived datatypes

string has the following built-in  derived datatypes:

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, 1, false, 0}, with '1' being the same as 'true' and '0' being the same as 'false'.

3.2.2.2 Constraining facets

boolean has the following constraining facets:

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 whose absolute value is less than 2^24, and e is an integer 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" or "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 lexical rules for integer and decimal. If the "E" or "e" and the following exponent are omitted, an exponent value of 0 is assumed.

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

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 whose absolute value is less than 2^53, and e is an integer 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" or "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 lexical rules for integer and decimal. If the "E" or "e" and the following exponent are omitted, an exponent value of 0 is assumed.

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

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 and n are integers, with n being known as the scale of the value space.

NOTE: The use of arbitrary precision decimal numbers (including all datatypes derived from decimal [e.g., integer]) in this design impacts the implementation of schema processors in a number of places: checking maxlength constraints on strings, for example. It may impact interchange between XML schemas and programming languages, databases, etc.

Our design discussions did not reveal convincing evidence of undue burden because of arbitrary precision decimal numbers in this design, but we welcome further input from implementors.
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.3 Derived datatypes

decimal has the following built-in  derived datatypes:

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

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 PnYnMnDTnH nMnS, where nY represents the number of years, nM the number of months, nD the number of days, 'T' is the date/time separator, nH the number of hours, nM the number of minutes and nS 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: P1Y2M3DT10H30M.

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

timeDuration has the following constraining facets:

3.2.8 recurringInstant

[Definition:]  recurringInstant represents an instant of time that recurs with a specific timeInstant.

Note that we do not attempt to support general recurring instants of time, just those that needed to support date and time and those that arise from truncated and reduced lexical representations of timeInstant. 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. 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

recurringInstant has the following constraining facets:

3.2.8.3 Derived datatypes

recurringInstant has the following built-in  derived datatypes:

3.2.9 binary

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

Constraint: encoding required for binary
It is an error for binary to be used directly in a schema. Only datatypes that are derived from binary by specify a value for encoding can be used in a schema.
3.2.9.1 Constraining facets

binary has the following constraining facets:

Ed. Note: What does the pattern facet on binary really mean? Since pattern operates on the lexical space, one would have to give a regex for the base64 or hex that would result for a specifc binary sequence that one wanted to constrain...this is not too far fetched for hex, but almost impossible for base64, isn't it?

3.2.10 uri-reference

[Definition:]  uri-reference represents a Uniform Resource Identifier (URI) Reference as defined in Section 4 of [RFC 2396]. A uri-reference may be absolute or relative, and may have an optional fragment identifier.

[Definition:]   An absolute uri-reference refers to a resource in a manner which is independent of the context in which the uri-reference occurs.

[Definition:]   A relative uri-reference refers to a resource by describing the difference within a hierarchy of resources between the context in which the relative uri-reference occurs and the absolute uri-reference of the resource.

3.2.10.1 Lexical representation

to be filled in a future point release

3.2.10.2 Constraining facets

uri-reference has the following constraining facets:

3.2.11 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 NCName production in [Namespaces in XML].

NOTE: The value space of ID is scoped to a specifc instance document.

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

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.2.12 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].

Issue (idref-subtype-of-id): Can IDREF be defined as a subtype of ID? Since every IDREF must also be an ID I think we're OK...we get around the problem of validation requirements not being supported by our general facet mechanism because of this. However, the only way to do that today would be as follows: <simpleType name='IDREF' basetype='ID'/>, that is, by not giving any facets and, in effect, saying that the value spaces are identical; but, isn't the "real" value space of IDREF a restriction (i.e., a proper subset) of the value space of ID?

NOTE: The value space of IDREF is scoped to a specifc instance document.

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

Constraint: IDREF
An IDREF must match the value of an ID in the XML document in which it occurs.
3.2.12.2 Derived datatypes

IDREF has the following built-in  derived datatypes:

3.2.13 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 DTD. The lexical space of ENTITY is the set of all strings that match the NCName production in [Namespaces in XML].

Ed. Note: Need a reference to unparsed entity in XML 1.0

NOTE: The value space of ENTITY is scoped to a specifc instance document.
Constraint: ENTITY declared
ENTITY values must match an unparsed entity name that is declared in the schema.

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

3.2.13.2 Derived datatypes

ENTITY has the following built-in  derived datatypes:

3.2.14 NOTATION

[Definition:]  NOTATION represents the NOTATION attribute type from [XML 1.0 Recommendation]. 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].

NOTE: The value space of NOTATION is scoped to a specifc instance document.
Constraint: NOTATION declared
NOTATION values must match a notation name that is declared in the schema.

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

3.3 Derived datatypes

This section gives conceptual definitions for all built-in derived datatypes defined by this specification. The XML Representation used to define derived datatypes (whether built-in or user-derived) is given in section Datatype Definitions (§5.1) and the complete definitions of the built-in derived datatypes 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 base type of language is string.

3.3.2 IDREFS

[Definition:]  IDREFS represents the IDREFS attribute type from [XML 1.0 Recommendation]. The value space of IDREFS is the set of finite-length sequences of IDREFs that have been used in an XML document. The lexical space of IDREFS is the set of whitespace separated tokens, each of which is in the lexical space of IDREF. The base type of IDREFS is IDREF.

NOTE: The value space of IDREFS is scoped to a specifc instance document.

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

Ed. Note: Should we include the type definitions for all built-in-derived types inline, such as the following:

Example
<simpleType name="IDREFS" base="IDREF" derivedBy="list"/>
3.3.2.1 Constraining facets

IDREFS has the following constraining facets:

3.3.3 ENTITIES

[Definition:]  ENTITIES represents the ENTITIES attribute type from [XML 1.0 Recommendation]. The value space of ENTITIES is the set of finite-length sequences of ENTITYs that have been declared as unparsed entities in a DTD. The lexical space of ENTITIES is the set of whitespace separated tokens, each of which is in the lexical space of NMTOKEN. The base type of ENTITIES is ENTITY.

NOTE: The value space of ENTITIES is scoped to a specifc instance document.

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

3.3.3.1 Constraining facets

ENTITIES has the following constraining facets:

3.3.4 NMTOKEN

[Definition:]  NMTOKEN represents the NMTOKEN attribute type from [XML 1.0 Recommendation]. The value space of NMTOKEN is the set of tokens that match the Nmtoken production in [XML 1.0 Recommendation]. The lexical space of NMTOKEN is the set of strings that match the Nmtoken production in [XML 1.0 Recommendation]. The base type of NMTOKEN is string.

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

3.3.4.2 Derived datatypes

NMTOKEN has the following built-in  derived datatypes:

3.3.5 NMTOKENS

[Definition:]  NMTOKENS represents the NMTOKENS attribute type from [XML 1.0 Recommendation]. The value space of NMTOKENS is the set of fininte-length sequences of NMTOKENs. The lexical space of NMTOKENS is the set of whitespace separated tokens, each of which is in the lexical space of NMTOKEN. The base type of NMTOKENS is NMTOKEN.

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

3.3.5.1 Constraining facets

NMTOKENS has the following constraining facets:

3.3.6 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 base type of Name is string.

3.3.6.2 Derived datatypes

Name has the following built-in  derived datatypes:

3.3.7 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 base type of QName is Name.

3.3.8 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 base type of NCName is Name.

3.3.9 integer

[Definition:]  integer is derived from decimal by fixing the value of scale to be 0. This results in the standard mathematical concept of the integer numbers. The value space of integer is the infinite set {...,-2,-1,0,1,2,...} The base type of integer is decimal.

3.3.9.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.9.3 Derived datatypes

integer has the following built-in  derived datatypes:

3.3.10 non-positive-integer

[Definition:]   non-positive-integer is derived from integer by fixing the value of maxInclusive to be 0. This results in the standard mathematical concept of the non-positive integers. The value space of non-positive-integer is the infinite set {...,-2,-1,0}. The base type of non-positive-integer is integer.

3.3.10.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.10.2 Constraining facets

non-positive-integer has the following constraining facets:

3.3.10.3 Derived datatypes

non-positive-integer has the following built-in  derived datatypes:

3.3.11 negative-integer

[Definition:]   negative-integer is derived from non-positive-integer by fixing the value of maxInclusive to be -1. This results in the standard mathematical concept of the negative integers. The value space of negative-integer is the infinite set {...,-2,-1}. The base type of negative-integer is non-positive-integer.

3.3.11.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.11.2 Constraining facets

negative-integer has the following constraining facets:

3.3.12 long

[Definition:]  long is derived from integer by fixing the values of maxInclusive to be 9223372036854775807 and minInclusive to be -9223372036854775808. The base type of long is integer.

3.3.12.1 Lexical representation

long 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.12.3 Derived datatypes

long has the following built-in  derived datatypes:

3.3.13 int

[Definition:]  int is derived from long by fixing the values of maxInclusive to be 2147483647 and minInclusive to be -2147483648. The base type of int is long.

3.3.13.1 Lexical representation

int 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, 126789675, +100000.

3.3.13.3 Derived datatypes

int has the following built-in  derived datatypes:

3.3.14 short

[Definition:]  short is derived from short by fixing the values of maxInclusive to be 32767 and minInclusive to be -32768. The base type of short is int.

3.3.14.1 Lexical representation

short 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, 12678, +10000.

3.3.14.3 Derived datatypes

short has the following built-in  derived datatypes:

3.3.15 byte

[Definition:]  byte is derived from short by fixing the values of maxInclusive to be 127 and minInclusive to be -128. The base type of byte is short.

3.3.15.1 Lexical representation

byte 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, 126, +100.

3.3.16 non-negative-integer

[Definition:]   non-negative-integer is derived from integer by fixing the value of minInclusive to be 0. This results in 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 base type of non-negative-integer is integer.

3.3.16.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.16.2 Constraining facets

non-negative-integer has the following constraining facets:

3.3.16.3 Derived datatypes

non-negative-integer has the following built-in  derived datatypes:

3.3.17 unsigned-long

[Definition:]  unsigned-long is derived from non-negative-integer by fixing the values of maxInclusive to be 18446744073709551615. The base type of unsigned-long is non-negative-integer.

3.3.17.1 Lexical representation

unsigned-long 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: 0, 12678967543233, +100000.

3.3.17.2 Constraining facets

unsigned-long has the following constraining facets:

3.3.17.3 Derived datatypes

unsigned-long has the following built-in  derived datatypes:

3.3.18 unsigned-int

[Definition:]  unsigned-int is derived from unsigned-long by fixing the values of maxInclusive to be 4294967295. The base type of unsigned-int is unsigned-long.

3.3.18.1 Lexical representation

unsigned-int 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: 0, 1267896754, +100000.

3.3.18.2 Constraining facets

unsigned-int has the following constraining facets:

3.3.18.3 Derived datatypes

unsigned-int has the following built-in  derived datatypes:

3.3.19 unsigned-short

[Definition:]  unsigned-short is derived from unsigned-int by fixing the value maxInclusive to be 65535. The base type of unsigned-short is unsigned-int.

3.3.19.1 Lexical representation

unsigned-short 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: 0, 12678, +10000.

3.3.19.2 Constraining facets

unsigned-short has the following constraining facets:

3.3.19.3 Derived datatypes

unsigned-short has the following built-in  derived datatypes:

3.3.20 unsigned-byte

[Definition:]  unsigned-byte is derived from unsigned-short by fixing the value maxInclusive to be 255. The base type of unsigned-byte is unsigned-short.

3.3.20.1 Lexical representation

unsigned-byte 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: 0, 126, +100.

3.3.20.2 Constraining facets

unsigned-byte has the following constraining facets:

3.3.21 positive-integer

[Definition:]   positive-integer is derived from non-negative-integer by fixing the value of minInclusive to be 1. This results in the standard mathematical concept of the positive integer numbers. is the standard mathematical concept of the positive integers. The value space of positive-integer is the infinite set {1,2,...}. The base type of positive-integer is non-negative-integer.

3.3.21.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.21.2 Constraining facets

positive-integer has the following constraining facets:

3.3.22 date

[Definition:]  date represents a timeInstant 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 base type of date is recurringInstant.

3.3.22.1 Lexical Representation

The lexical representation for date is the reduced (right truncated) lexical representation for recurringInstant: CCYY-MM-DD. To accommodate 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 (CC).

3.3.22.2 Constraining facets

date has the following constraining facets:

3.3.23 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 base type of time is recurringInstant.

time can be considered to be a shorthand to designate a specific truncated representation for recurringInstant.

3.3.23.1 Lexical Representation

The lexical representation for time is the left truncated lexical representation for timeInstant: 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.23.2 Constraining facets

time has the following constraining facets:

4 Datatype components

The following sections provide full details on the properties and significance of each kind of schema component involved in datatype definitions.

Ed. Note: this section needs some more explanatory material

4.1 Datatype definition

Schema ComponentDatatype Definition
[name]
Optional. An NCName as defined by [Namespaces in XML].
Used in (§)
[base type definition]
A datatype definition.
[facets]
A possibly empty set of Constraining facets (§4.2).
[variety]
One of {atomic, list}.
[target namespace]
Either null or a namespace URI, as defined in [Namespaces in XML].
[annotation]
Optional. An annotation.
Constraint on Schemas: Unique datatype definitions
The {name} of the datatype being defined must be unique among the datatypes defined in the containing schema.
Validation Contribution: Datatype Valid
A sequence of character information items is schema-valid with respect to a datatype definition if:
  1. It is a member of the lexical space of the {base type definition}.
  2. The member of the value space of the {base type definition} denoted by the string is schema-valid with respect to the conditions expressed by all {facets} as per Facet valid (§4.2).

Datatypes are identified by their {name} and {target namespace}. Except for anonymous datatypes (those with no {name}), datatype definitions must be uniquely identified within an schema.

4.2 Constraining facets

This section provides the details of each constraining facet component.

Validation Contribution: Facet valid
A member of a value space is schema-valid with respect to a constraining facet component if:
  1. to be specified in detail in the next draft
  2. including mention of a validation constraint for each individual facet below

4.2.1 length

Schema Componentlength
[value]
A non-negative-integer (§3.3.16).
[annotation]
Optional. An annotation.

For datatypes derived from string, {value} is in characters. For datatypes derived from binary, {value} is in bits. For datatypes derived by list, {value} is in list items.

4.2.2 minlength

Schema Componentminlength
[value]
A non-negative-integer (§3.3.16).
[annotation]
Optional. An annotation.

For datatypes derived from string, {value} is in characters. For datatypes derived from binary, {value} is in bits. For datatypes derived by list, {value} is in list items.

4.2.3 maxlength

Schema Componentmaxlength
[value]
A non-negative-integer (§3.3.16).
[annotation]
Optional. An annotation.

For datatypes derived from string, {value} is in characters. For datatypes derived from binary, {value} is in bits. For datatypes derived by list, {value} is in list items.

4.2.4 pattern

Schema Componentpattern
[value]
A regular expression.
[annotation]
Optional. An annotation.

4.2.5 enumeration

Schema Componentenumeration
[value]
A value from the value space of the {base type definition}.
[annotation]
Optional. An annotation.

4.2.6 maxInclusive

Schema ComponentmaxInclusive
[value]
A value from the value space of the {base type definition}.
[annotation]
Optional. An annotation.

4.2.7 maxExclusive

Schema ComponentmaxExclusive
[value]
A value from the value space of the {base type definition}.
[annotation]
Optional. An annotation.

4.2.8 minExclusive

Schema ComponentminExclusive
[value]
A value from the value space of the {base type definition}.
[annotation]
Optional. An annotation.

4.2.9 minInclusive

Schema ComponentminInclusive
[value]
A value from the value space of the {base type definition}.
[annotation]
Optional. An annotation.

4.2.10 precision

Schema Componentprecision
[value]
A positive-integer.
[annotation]
Optional. An annotation.

4.2.11 scale

Schema Componentscale
[value]
A non-negative-integer.
[annotation]
Optional. An annotation.

4.2.12 encoding

Schema Componentencoding
[value]
One of {hex, base64}.
[annotation]
Optional. An annotation.

4.2.13 period

Schema Componentperiod
[value]
A timeInstant.
[annotation]
Optional. An annotation.

5 XML representation of datatype definitions

Ed. Note: this section needs some more explanatory material

5.1 Datatype Definitions

XML Representation SummarysimpleType Element Information Item

<simpleType
  abstract = boolean
  base = QName
  derivedBy = | list | reproduction | restriction  : restriction
  final =
  id = ID
  name = NCName>
  Content: ( annotation? , ( minExclusive | minInclusive | maxExclusive | maxInclusive | precision | scale | length | minlength | maxlength | encoding | period | enumeration | pattern )* )
</simpleType>

Datatype Definition Schema Component
PropertyRepresentation
{name} The value of the name [attribute]
{base type definition} The value of the base [attribute]
{variety} list ff the value of the derivedBy [attribute] (or the derivedBy [attribute] of any ancestor) is list; otherwise atomic.
{target namespace} The value of the targetNamespace [attribute] of the parent schema element information item.

A derived datatype can be derived from a primitive datatype or another derived datatype by one of two means: by restriction or by list.

5.1.1 Derivation by restriction

Example
An electronic commerce schema might define a datatype called Sku (the barcode number that appears on products) from the built-in datatype string by supplying a value for the pattern facet.
<simpleType name="Sku" base="string">
    <pattern value="\d{3}-[A-Z]{2}"/>
</simpleType>
In this case, Sku is the name of the new user-derived datatype, string is its base type and pattern is the facet.

5.1.2 Derivation by list

Example
blah, blah, blah
<simpleType name="listOfFloat" base="float" derivedBy='list'/>
In this case, listOfFloat is the name of the new user-derived datatype, float is its base type and list is the derivation method.

As mentioned in List datatypes (§2.5.1.2), when a datatype is derived from a list datatype, the following constraining facets may be used:

For each of the above facets, the unit of length is measured in list items.

5.2 Constraining facets

This section details the XML Representation for specificing constraining facets in a datatype definition.

5.2.1 length

XML Representation Summarylength Element Information Item

<length
  id = ID
  value = non-negative-integer>
  Content: ( annotation? )
</length>

length Schema Component
PropertyRepresentation
{value} The value of the value [attribute]
Example
The following is the definition of a user-derived datatype to represent one form of postal codes in the United States, by limiting strings to be exactly 5 characters in length.
<simpleType name="us-zipcode" base="string">
    <length value='5'/>
</simpleType>

Ed. Note: this is a bad example, but its the only one I could think of at the time.

5.2.2 minlength

XML Representation Summaryminlength Element Information Item

<minlength
  id = ID
  value = non-negative-integer>
  Content: ( annotation? )
</minlength>

minlength Schema Component
PropertyRepresentation
{value} The value of the value [attribute]
Example
The following is the definition of a user-derived datatype which requires strings to have at least one character (i.e., the empty string is not in the value space of this datatype).
<simpleType name="non-empty-string" base="string">
    <minlength value='1'/>
</simpleType>

5.2.3 maxlength

XML Representation Summarymaxlength Element Information Item

<maxlength
  id = ID
  value = non-negative-integer>
  Content: ( annotation? )
</maxlength>

maxlength Schema Component
PropertyRepresentation
{value} The value of the value [attribute]
Example
The following is the definition of a user-derived datatype which might be used to accept form input with an upper limit to the number of characters that are acceptable.
<simpleType name="form-input" base="string">
    <maxlength value='50'/>
</simpleType>

5.2.4 pattern

XML Representation Summarypattern Element Information Item

<pattern
  id = ID
  value = string>
  Content: ( annotation? )
</pattern>

{value} must be a valid regular expression.
pattern Schema Component
PropertyRepresentation
{value} The value of the value [attribute]
Example
The following is the definition of a user-derived datatype which is a better representation of postal codes in the United States, by limiting strings to those which are matched by a specific regular expression.
<simpleType name="better-us-zipcode" base="string">
    <pattern value='[0-9]{5}(-[0-9]{4})?'/>
</simpleType>

5.2.5 enumeration

XML Representation Summaryenumeration Element Information Item

<enumeration
  id = ID
  value = string>
  Content: ( annotation? )
</enumeration>

{value} must be a valid value of the {base type definition}.
enumeration Schema Component
PropertyRepresentation
{value} The value of the value [attribute]
Example
The following example is a datatype definition for a user-derived 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 base type.
<simpleType name="holidays" base="date">
    <annotation>
        <documentation>some US holidays</documentation>
    </annotation>
    <enumeration value='--01-01'>
        <annotation>
            <documentation>New Year's day</documentation>
        </annotation>
    </enumeration>
    <enumeration value='--07-04'/>
        <annotation>
            <documentation>4th of July</documentation>
        </annotation>
    </enumeration>
    <enumeration value='--12-25'/>
        <annotation>
            <documentation>Christmas</documentation>
        </annotation>
    </enumeration>
</simpleType>

5.2.6 maxInclusive

XML Representation SummarymaxInclusive Element Information Item

<maxInclusive
  id = ID
  value = string>
  Content: ( annotation? )
</maxInclusive>

{value} must be a valid value of the {base type definition}.
maxInclusive Schema Component
PropertyRepresentation
{value} The value of the value [attribute]
Example
The following is the definition of a user-derived datatype which limits values to integers less than or equal to 100, using maxInclusive.
<simpleType name="one-hundred-or-less" base="integer">
    <maxInclusive value='100'/>
</simpleType>

5.2.7 maxExclusive

XML Representation SummarymaxExclusive Element Information Item

<maxExclusive
  id = ID
  value = string>
  Content: ( annotation? )
</maxExclusive>

{value} must be a valid value of the {base type definition}.
maxExclusive Schema Component
PropertyRepresentation
{value} The value of the value [attribute]
Example
The following is the definition of a user-derived datatype which limits values to integers less than or equal to 100, using maxExclusive.
<simpleType name="less-than-one-hundred-and-one" base="integer">
    <maxExclusive value='101'/>
</simpleType>
Note that the value space of this datatype is identical to the previous one (named 'one-hundred-or-less').

5.2.8 minInclusive

XML Representation SummaryminInclusive Element Information Item

<minInclusive
  id = ID
  value = string>
  Content: ( annotation? )
</minInclusive>

{value} must be a valid value of the {base type definition}.
minInclusive Schema Component
PropertyRepresentation
{value} The value of the value [attribute]
Example
The following is the definition of a user-derived datatype which limits values to integers greater than or equal to 100, using minInclusive.
<simpleType name="one-hundred-or-more" base="integer">
    <minInclusive value='100'/>
</simpleType>

5.2.9 minExclusive

XML Representation SummaryminExclusive Element Information Item

<minExclusive
  id = ID
  value = string>
  Content: ( annotation? )
</minExclusive>

{value} must be a valid value of the {base type definition}.
minExclusive Schema Component
PropertyRepresentation
{value} The value of the value [attribute]
Example
The following is the definition of a user-derived datatype which limits values to integers greater than or equal to 100, using minExclusive.
<simpleType name="more-than-ninety-nine" base="integer">
    <minExclusive value='99'/>
</simpleType>
Note that the value space of this datatype is identical to the previous one (named 'one-hundred-or-more').

5.2.10 precision

XML Representation Summaryprecision Element Information Item

<precision
  id = ID
  value = non-negative-integer>
  Content: ( annotation? )
</precision>

precision Schema Component
PropertyRepresentation
{value} The value of the value [attribute]
Example
The following is the definition of a user-derived datatype which limits values to integers greater than or equal to 100, using minExclusive.
<simpleType name="less-than-one-hundred" base="decimal">
    <minExclusive value='99'/>
</simpleType>

5.2.11 scale

XML Representation Summaryscale Element Information Item

<scale
  id = ID
  value = non-negative-integer>
  Content: ( annotation? )
</scale>

scale Schema Component
PropertyRepresentation
{value} The value of the value [attribute]
Example
The following is the definition of a user-derived 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 base type in a manner specific to the base type (different than specifying max/min values as before)
<simpleType name="amount" base="decimal">
    <precision value='8'/>
    <scale value='2'/>
</simpleType>

5.2.12 encoding

XML Representation Summaryencoding Element Information Item

<encoding
  id = ID
  value = | base64 | hex >
  Content: ( annotation? )
</encoding>

encoding Schema Component
PropertyRepresentation
{value} The value of the value [attribute]
Example
The following example is a datatype definition for a user-derived datatype whose value space is the set of binary streams of length 4 octets (32 bits) and whose lexical space is the set of base64 encodings of such binary streams. This datatype definition would appear in a schema authored by an "end-user" and shows how to define a datatype by specifying multiple constraining facets.
<simpleType name='myBinary' base='binary'>
    <length value='4'/>
    <encoding value='base64'/>
</simpleType>

5.2.13 period

XML Representation Summaryperiod Element Information Item

<period
  id = ID
  value = timeDuration>
  Content: ( annotation? )
</period>

period Schema Component
PropertyRepresentation
{value} The value of the value [attribute]

6 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, 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. Similarly, for a datatype derived from string 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, timeInstant, recurringInstant, date and time values must conform to legal Gregorian dates and legal time values as specified in the descriptions of these 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" "../structures/structures.dtd" [
<!ATTLIST element xmlns:x CDATA #IMPLIED><!-- keep this schema XML1.0 valid -->
]>
<schema xmlns="&XMLSchemaNS;" targetNamespace="&XMLSchemaNS;" version="Id: datatypes.xsd,v 1.30 2000/02/23 18:02:05 ht Exp ">
  <annotation>
   <documentation>Note that the namespace declaration for the builtins
                  namespace is in structures.dtd so it can be customised</documentation>
  </annotation>

  <annotation>
   <documentation>Import the builtins, and rename them all into this namespace
                  as well</documentation>
  </annotation>

 <!-- get access to the xml: attribute groups for xml:lang -->
 <import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/XML/1998/xml.xsd"/>

  <import namespace="&XMLSchemaNS;/datatypes" schemaLocation="&XSP2.base;/builtins.xsd"/>

  <simpleType name="urSimpleType" base="&dtp;urSimpleType"/>
  <simpleType name="string" base="&dtp;string"/>
  <simpleType name="boolean" base="&dtp;boolean"/>
  <simpleType name="float" base="&dtp;float"/>
  <simpleType name="double" base="&dtp;double"/>
  <simpleType name="decimal" base="&dtp;decimal"/>
  <simpleType name="timeInstant" base="&dtp;timeInstant"/>
  <simpleType name="timeDuration" base="&dtp;timeDuration"/>
  <simpleType name="recurringInstant" base="&dtp;recurringInstant"/>
  <simpleType name="binary" base="&dtp;binary"/>
  <simpleType name="uri-reference" base="&dtp;uri-reference"/>
  <simpleType name="language" base="&dtp;language"/>
  <simpleType name="integer" base="&dtp;integer"/>
  <simpleType name="non-negative-integer" base="&dtp;non-negative-integer"/>
  <simpleType name="positive-integer" base="&dtp;positive-integer"/>
  <simpleType name="non-positive-integer" base="&dtp;non-positive-integer"/>
  <simpleType name="negative-integer" base="&dtp;negative-integer"/>
  <simpleType name="byte" base="&dtp;byte"/>
  <simpleType name="int" base="&dtp;int"/>
  <simpleType name="long" base="&dtp;long"/>
  <simpleType name="short" base="&dtp;short"/>
  <simpleType name="unsigned-byte" base="&dtp;unsigned-byte"/>
  <simpleType name="unsigned-int" base="&dtp;unsigned-int"/>
  <simpleType name="unsigned-long" base="&dtp;unsigned-long"/>
  <simpleType name="unsigned-short" base="&dtp;unsigned-short"/>
  <simpleType name="date" base="&dtp;date"/>
  <simpleType name="time" base="&dtp;time"/>
  <simpleType name="NMTOKENS" base="&dtp;NMTOKENS"/>
  <simpleType name="NMTOKEN" base="&dtp;NMTOKEN"/>
  <simpleType name="Name" base="&dtp;Name"/>
  <simpleType name="ID" base="&dtp;ID"/>
  <simpleType name="IDREFS" base="&dtp;IDREFS"/>
  <simpleType name="IDREF" base="&dtp;IDREF"/>
  <simpleType name="ENTITIES" base="&dtp;ENTITIES"/>
  <simpleType name="ENTITY" base="&dtp;ENTITY"/>
  <simpleType name="NCName" base="&dtp;NCName"/>
  <simpleType name="QName" base="&dtp;QName"/>
  <simpleType name="NOTATION" base="&dtp;NOTATION"/>

  <complexType name="openAttrs" content="empty">
   <annotation>
    <documentation>This type is extended by almost all schema types
                   to allow attributes from other namespaces to be
                   added to user schemas.</documentation>
   </annotation>
   <anyAttribute namespace="##other"/>
  </complexType>

  <complexType name="annotated" base="openAttrs" derivedBy="extension" content="elementOnly">
   <annotation>
    <documentation>This type is extended by all types which allow annotation
          other than &lt;schema> itself</documentation>
   </annotation>
   <element ref="annotation" minOccurs="0"/>
   <attribute name="id" type="ID"/>
  </complexType>

  <complexType name="simpleType" base="annotated" derivedBy="extension" abstract="true">
    <element ref="facet" minOccurs="0" maxOccurs="*"/>
    <attribute name="name" type="NCName" minOccurs="0">
      <annotation>
       <documentation>Can be restricted to required or forbidden</documentation>
      </annotation>
    </attribute>
    <attribute name="base" type="QName" minOccurs="1"/>
    <attribute name="final">
     <simpleType base="&dtp;string">
      <annotation>
       <documentation>#all or (possibly empty) subset of {list,
                      restriction, reproduction}</documentation>
       <documentation>A utility type, not for public use</documentation>
       <documentation>Should be a sequence drawn from the values of
                      the set below, or #all -- regexp
                      is only an approximation</documentation>
      </annotation>
      <pattern value="#all?|(extension|list| )*"/>
     </simpleType>
    </attribute>
    <attribute name="abstract" type="boolean"/>
    <attribute name="derivedBy" default="restriction">
     <simpleType base="&dtp;NMTOKEN">
      <enumeration value="list"/>
      <enumeration value="restriction"/>
      <enumeration value="reproduction"/>
     </simpleType>
    </attribute>
  </complexType>

  <complexType name="namedDatatype" base="simpleType">
   <annotation>
    <documentation>This was formerly for the top-level datatype element,
          as ref'ed in &lt;schema</documentation>
   </annotation>
   <attribute name="name" minOccurs="1">
    <annotation><documentation>Required at the top level</documentation></annotation>
   </attribute>   
  </complexType>

  <complexType name="anonDatatype" base="simpleType">
   <annotation>
    <documentation>This was for the nested datatype element,
          as formerly used in &lt;element</documentation>
   </annotation>
   <attribute name="name" maxOccurs="0">
    <annotation><documentation>Forbidden when nested</documentation></annotation>
   </attribute>   
  </complexType>

  <element name="simpleType" equivClass="schemaTop" type="simpleType"/>

  <complexType name="facet" base="annotated" derivedBy="extension">
    <attribute name="value" minOccurs="1"/>
  </complexType>

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

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

  <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 -->
  <element name="encoding" equivClass="facet">
   <complexType base="facet" derivedBy="restriction">
     <attribute name="value">
      <simpleType base="&dtp;NMTOKEN">
       <annotation>
	<documentation>A utility type, not for public use</documentation>
       </annotation>
	<enumeration value="hex">
	  <annotation>
	    <documentation>each (8-bit) byte is encoded as a sequence
		  of 2 hexidecimal digits</documentation>
	  </annotation>
	</enumeration>
	<enumeration value="base64">
	  <annotation>
	    <documentation>value is encoded in Base64 as defined
                           in the MIME RFC</documentation>
	  </annotation>
	</enumeration>
      </simpleType>
     </attribute>
   </complexType>
  </element>

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

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

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

  <element name="annotation" xmlns:x="http://www.w3.org/XML/1998/namespace">
   <complexType>
    <choice minOccurs="0" maxOccurs="*">
     <element name="appinfo">
       <complexType content="mixed">
         <any minOccurs="0" maxOccurs="*" processContents="lax"/>
         <attribute name="source" type="uri-reference"/>
       </complexType>
     </element>
     <element name="documentation">
       <complexType content="mixed">
         <any minOccurs="0" maxOccurs="*" processContents="lax"/>
         <attribute name="source" type="uri-reference"/>
         <attributeGroup ref="x:lang"/>
       </complexType>
     </element>
    </choice>
   </complexType>
  </element>

</schema>
<?xml version='1.0'?>
<!-- XML Schema schema for XML Schemas: Part 2: Datatypes -->
<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSCHEMA 19991216//EN" "structures.dtd">
<schema xmlns="&XMLSchemaNS;" targetNamespace="&XMLSchemaNS;/datatypes" version="Id: builtins.xsd,v 1.7 2000/02/24 23:41:10 ht Exp ">
    <annotation>
   <documentation>Note that the namespace declaration for the builtins
                  namespace is in structures.dtd so it can be customised</documentation>
  </annotation>

 <annotation>
  <documentation>stubs for built-in primitive datatypes follow</documentation>
 </annotation>
 <simpleType name="urSimpleType" base="&dtp;urSimpleType" derivedBy="reproduction"/>
 <simpleType name="string" base="&dtp;urSimpleType">
  	<annotation>
 		<appinfo><has-facet name='length'/></appinfo>
 		<appinfo><has-facet name='minlength'/></appinfo>
 		<appinfo><has-facet name='maxlength'/></appinfo>
 		<appinfo><has-facet name='pattern'/></appinfo>
 		<appinfo><has-facet name='enumeration'/></appinfo>
 		<appinfo><has-facet name='maxInclusive'/></appinfo>
 		<appinfo><has-facet name='maxExclusive'/></appinfo>
 		<appinfo><has-facet name='minInclusive'/></appinfo>
 		<appinfo><has-facet name='minExclusive'/></appinfo>
 	</annotation>
</simpleType>
 <simpleType name="boolean" base="&dtp;urSimpleType">
  	<annotation>
 		<appinfo><has-facet name='pattern'/></appinfo>
 	</annotation>
</simpleType>
 <simpleType name="float" base="&dtp;urSimpleType">
 	<annotation>
 		<appinfo><has-facet name='pattern'/></appinfo>
 		<appinfo><has-facet name='enumeration'/></appinfo>
 		<appinfo><has-facet name='maxInclusive'/></appinfo>
 		<appinfo><has-facet name='maxExclusive'/></appinfo>
 		<appinfo><has-facet name='minInclusive'/></appinfo>
 		<appinfo><has-facet name='minExclusive'/></appinfo>
 	</annotation>
</simpleType>
 <simpleType name="double" base="&dtp;urSimpleType">
  	<annotation>
 		<appinfo><has-facet name='pattern'/></appinfo>
 		<appinfo><has-facet name='enumeration'/></appinfo>
 		<appinfo><has-facet name='maxInclusive'/></appinfo>
 		<appinfo><has-facet name='maxExclusive'/></appinfo>
 		<appinfo><has-facet name='minInclusive'/></appinfo>
 		<appinfo><has-facet name='minExclusive'/></appinfo>
 	</annotation>
</simpleType>
 <simpleType name="decimal" base="&dtp;urSimpleType">
  	<annotation>
 		<appinfo><has-facet name='precision'/></appinfo>
 		<appinfo><has-facet name='scale'/></appinfo>
 		<appinfo><has-facet name='pattern'/></appinfo>
 		<appinfo><has-facet name='enumeration'/></appinfo>
 		<appinfo><has-facet name='maxInclusive'/></appinfo>
 		<appinfo><has-facet name='maxExclusive'/></appinfo>
 		<appinfo><has-facet name='minInclusive'/></appinfo>
 		<appinfo><has-facet name='minExclusive'/></appinfo>
 	</annotation>
</simpleType>
 <simpleType name="timeInstant" base="&dtp;urSimpleType">
  	<annotation>
 		<appinfo><has-facet name='pattern'/></appinfo>
 		<appinfo><has-facet name='enumeration'/></appinfo>
 		<appinfo><has-facet name='maxInclusive'/></appinfo>
 		<appinfo><has-facet name='maxExclusive'/></appinfo>
 		<appinfo><has-facet name='minInclusive'/></appinfo>
 		<appinfo><has-facet name='minExclusive'/></appinfo>
 	</annotation>
</simpleType>
 <simpleType name="timeDuration" base="&dtp;urSimpleType">
  	<annotation>
 		<appinfo><has-facet name='pattern'/></appinfo>
 		<appinfo><has-facet name='enumeration'/></appinfo>
 		<appinfo><has-facet name='maxInclusive'/></appinfo>
 		<appinfo><has-facet name='maxExclusive'/></appinfo>
 		<appinfo><has-facet name='minInclusive'/></appinfo>
 		<appinfo><has-facet name='minExclusive'/></appinfo>
 	</annotation>
</simpleType>
 <simpleType name="recurringInstant" base="&dtp;urSimpleType">
  	<annotation>
 		<appinfo><has-facet name='period'/></appinfo>
 		<appinfo><has-facet name='pattern'/></appinfo>
 		<appinfo><has-facet name='enumeration'/></appinfo>
 		<appinfo><has-facet name='maxInclusive'/></appinfo>
 		<appinfo><has-facet name='maxExclusive'/></appinfo>
 		<appinfo><has-facet name='minInclusive'/></appinfo>
 		<appinfo><has-facet name='minExclusive'/></appinfo>
 	</annotation>
</simpleType>
 <simpleType name="binary" base="&dtp;urSimpleType">
  	<annotation>
 		<appinfo><has-facet name='encoding'/></appinfo>
 		<appinfo><has-facet name='length'/></appinfo>
 		<appinfo><has-facet name='minlength'/></appinfo>
 		<appinfo><has-facet name='maxlength'/></appinfo>
 		<appinfo><has-facet name='pattern'/></appinfo>
 		<appinfo><has-facet name='enumeration'/></appinfo>
 	</annotation>
</simpleType>
 <simpleType name="uri-reference" base="&dtp;urSimpleType">
  	<annotation>
		<appinfo><has-facet name='length'/></appinfo>
		<appinfo><has-facet name='minlength'/></appinfo>
		<appinfo><has-facet name='maxlength'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
	</annotation>
</simpleType>
 <simpleType name="ID" base="&dtp;urSimpleType">
 	<annotation>
		<appinfo><has-facet name='length'/></appinfo>
		<appinfo><has-facet name='minlength'/></appinfo>
		<appinfo><has-facet name='maxlength'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
	</annotation>
 </simpleType>
 <simpleType name="IDREF" base="&dtp;urSimpleType">
 	<annotation>
		<appinfo><has-facet name='length'/></appinfo>
		<appinfo><has-facet name='minlength'/></appinfo>
		<appinfo><has-facet name='maxlength'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
	</annotation>
 </simpleType>
 <simpleType name="ENTITY" base="&dtp;urSimpleType">
 	<annotation>
		<appinfo><has-facet name='length'/></appinfo>
		<appinfo><has-facet name='minlength'/></appinfo>
		<appinfo><has-facet name='maxlength'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
	</annotation>
 </simpleType>
 <simpleType name="NOTATION" base="&dtp;urSimpleType">
 	<annotation>
		<appinfo><has-facet name='length'/></appinfo>
		<appinfo><has-facet name='minlength'/></appinfo>
		<appinfo><has-facet name='maxlength'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
	</annotation>
 </simpleType>

  <simpleType name="language" base="&dtp;string">
     <annotation>
		<appinfo><has-facet name='length'/></appinfo>
		<appinfo><has-facet name='minlength'/></appinfo>
		<appinfo><has-facet name='maxlength'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
      </annotation>
    <pattern value="([a-zA-Z]{2}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]+)(-[a-zA-Z]+)*">
      <annotation>
        <documentation source="http://www.w3.org/TR/REC-xml#NT-LanguageID">
          pattern matches production 33 from the XML spec
        </documentation>
      </annotation>
    </pattern>
  </simpleType>
  
  <simpleType name="integer" base="&dtp;decimal">
 	<annotation>
		<appinfo><has-facet name='precision'/></appinfo>
		<appinfo><has-facet name='scale'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
	</annotation>
    <scale value="0"/>
  </simpleType>
        
  <simpleType name="non-positive-integer" base="&dtp;integer">
 	<annotation>
		<appinfo><has-facet name='precision'/></appinfo>
		<appinfo><has-facet name='scale'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
	</annotation>
    <maxInclusive value="0"/>
  </simpleType>

  <simpleType name="negative-integer" base="&dtp;non-positive-integer">
 	<annotation>
		<appinfo><has-facet name='precision'/></appinfo>
		<appinfo><has-facet name='scale'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
	</annotation>
    <maxInclusive value="-1"/>
  </simpleType>

  <simpleType name="long" base="&dtp;integer">
 	<annotation>
		<appinfo><has-facet name='precision'/></appinfo>
		<appinfo><has-facet name='scale'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
	</annotation>
    <minInclusive value="-9223372036854775808"/>
    <maxInclusive value="9223372036854775807"/>
  </simpleType>

  <simpleType name="int" base="&dtp;long">
 	<annotation>
		<appinfo><has-facet name='precision'/></appinfo>
		<appinfo><has-facet name='scale'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
	</annotation>
    <minInclusive value="-2147483648"/>
    <maxInclusive value="2147483647"/>
  </simpleType>
  
  <simpleType name="short" base="&dtp;int">
 	<annotation>
		<appinfo><has-facet name='precision'/></appinfo>
		<appinfo><has-facet name='scale'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
	</annotation>
    <minInclusive value="-32768"/>
    <maxInclusive value="32767"/>
  </simpleType>
  
  <simpleType name="byte" base="&dtp;short">
 	<annotation>
		<appinfo><has-facet name='precision'/></appinfo>
		<appinfo><has-facet name='scale'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
	</annotation>
    <minInclusive value="-128"/>
    <maxInclusive value="127"/>
  </simpleType>
  
  <simpleType name="non-negative-integer" base="&dtp;integer">
 	<annotation>
		<appinfo><has-facet name='precision'/></appinfo>
		<appinfo><has-facet name='scale'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
	</annotation>
    <minInclusive value="0"/>
  </simpleType>

  <simpleType name="unsigned-long" base="&dtp;non-negative-integer">
 	<annotation>
		<appinfo><has-facet name='precision'/></appinfo>
		<appinfo><has-facet name='scale'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
	</annotation>
    <maxInclusive value="18446744073709551615"/>
  </simpleType>
  
  <simpleType name="unsigned-int" base="&dtp;unsigned-long">
 	<annotation>
		<appinfo><has-facet name='precision'/></appinfo>
		<appinfo><has-facet name='scale'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
	</annotation>
    <maxInclusive value="4294967295"/>
  </simpleType>
  
  <simpleType name="unsigned-short" base="&dtp;unsigned-int">
 	<annotation>
		<appinfo><has-facet name='precision'/></appinfo>
		<appinfo><has-facet name='scale'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
	</annotation>
    <maxInclusive value="65535"/>
  </simpleType>
  
  <simpleType name="unsigned-byte" base="&dtp;unsigned-short">
 	<annotation>
		<appinfo><has-facet name='precision'/></appinfo>
		<appinfo><has-facet name='scale'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
	</annotation>
    <maxInclusive value="255"/>
  </simpleType>
  
  <simpleType name="positive-integer" base="&dtp;non-negative-integer">
 	<annotation>
		<appinfo><has-facet name='precision'/></appinfo>
		<appinfo><has-facet name='scale'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
	</annotation>
    <minInclusive value="1"/>
  </simpleType>

  <simpleType name="date" base="&dtp;recurringInstant">
 	<annotation>
		<appinfo><has-facet name='period'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
	</annotation>
    <period value="000000T2400"/>
  </simpleType>

  <simpleType name="time" base="&dtp;recurringInstant">
 	<annotation>
		<appinfo><has-facet name='period'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
	</annotation>
    <period value="000000T2400"/>
  </simpleType>

  <simpleType name="NMTOKEN" base="&dtp;string">
     <annotation>
	    <appinfo><has-facet name='length'/></appinfo>
		<appinfo><has-facet name='minlength'/></appinfo>
		<appinfo><has-facet name='maxlength'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
      </annotation>
    <pattern value="\c+">
      <annotation>
        <documentation source="http://www.w3.org/TR/REC-xml#NT-Nmtoken">
          pattern matches production 7 from the XML spec
        </documentation>
      </annotation>
    </pattern>
  </simpleType>
  
  <simpleType name="NMTOKENS" base="NMTOKEN" derivedBy="list">
 	<annotation>
		<appinfo><has-facet name='length'/></appinfo>
		<appinfo><has-facet name='minlength'/></appinfo>
		<appinfo><has-facet name='maxlength'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
	</annotation>
  </simpleType>

  <simpleType name="Name" base="&dtp;string">
     <annotation>
		<appinfo><has-facet name='length'/></appinfo>
		<appinfo><has-facet name='minlength'/></appinfo>
		<appinfo><has-facet name='maxlength'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
      </annotation>
    <pattern value="\i\c*">
      <annotation>
        <documentation source="http://www.w3.org/TR/REC-xml#NT-Name">
          pattern matches production 5 from the XML spec
        </documentation>
      </annotation>
    </pattern>
  </simpleType>

  <simpleType name="QName" base="&dtp;Name">
     <annotation>
	    <appinfo><has-facet name='length'/></appinfo>
		<appinfo><has-facet name='minlength'/></appinfo>
		<appinfo><has-facet name='maxlength'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
      </annotation>
    <pattern value="([\i-[:]][\c-[:]]*:)?[\i-[:]][\c-[:]]*">
      <annotation>
        <documentation source="http://www.w3.org/TR/REC-xml-names/#NT-QName">
          pattern matches production 6 from the Namespaces in XML spec
        </documentation>
      </annotation>
    </pattern>
  </simpleType>


  <simpleType name="NCName" base="&dtp;Name">
     <annotation>
		<appinfo><has-facet name='length'/></appinfo>
		<appinfo><has-facet name='minlength'/></appinfo>
		<appinfo><has-facet name='maxlength'/></appinfo>
		<appinfo><has-facet name='pattern'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
		<appinfo><has-facet name='maxInclusive'/></appinfo>
		<appinfo><has-facet name='maxExclusive'/></appinfo>
		<appinfo><has-facet name='minInclusive'/></appinfo>
		<appinfo><has-facet name='minExclusive'/></appinfo>
	 </annotation>
	<pattern value="[\i-[:]][\c-[:]]*">
      <annotation>
        <documentation source="http://www.w3.org/TR/REC-xml-names/#NT-NCName">
          pattern matches production 4 from the Namespaces in XML spec
        </documentation>
     </annotation>
    </pattern>
  </simpleType>
  
  <simpleType name="IDREFS" base="IDREF" derivedBy="list">
 	<annotation>
		<appinfo><has-facet name='length'/></appinfo>
		<appinfo><has-facet name='minlength'/></appinfo>
		<appinfo><has-facet name='maxlength'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
	</annotation>
  </simpleType>

  <simpleType name="ENTITIES" base="ENTITY" derivedBy="list">
 	<annotation>
		<appinfo><has-facet name='length'/></appinfo>
		<appinfo><has-facet name='minlength'/></appinfo>
		<appinfo><has-facet name='maxlength'/></appinfo>
		<appinfo><has-facet name='enumeration'/></appinfo>
	</annotation>
  </simpleType>
</schema>

B DTD for Datatype Definitions (normative)

<!-- DTD for XML Schemas: Part 2: Datatypes -->
<!-- Id: datatypes.dtd,v 1.23 2000/02/23 18:02:05 ht Exp  -->
<!ENTITY % p ''> <!-- can be overriden in the internal subset of a
                      schema document to establish a namespace prefix -->
<!ENTITY % dts ':dt'>
<!ENTITY % dtp 'dt:'>
<!ENTITY % dtpv '"%dtp;"'>
<!ENTITY % dtnds 'xmlns%dts;'>
<!ENTITY dtp %dtpv;>

<!-- Define all the element names, with optional prefix -->
<!ENTITY % simpleType "%p;simpleType">
<!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">

<!-- Customisation entities for the ATTLIST of each element type.
     Define one of these if your schema takes advantage of the
     anyAttribute='##other' in the schema for schemas -->

<!ENTITY % simpleTypeAttrs ''>
<!ENTITY % maxExclusiveAttrs ''>
<!ENTITY % minExclusiveAttrs ''>
<!ENTITY % maxInclusiveAttrs ''>
<!ENTITY % minInclusiveAttrs ''>
<!ENTITY % precisionAttrs ''>
<!ENTITY % scaleAttrs ''>
<!ENTITY % lengthAttrs ''>
<!ENTITY % minlengthAttrs ''>
<!ENTITY % maxlengthAttrs ''>
<!ENTITY % enumerationAttrs ''>
<!ENTITY % patternAttrs ''>
<!ENTITY % encodingAttrs ''>
<!ENTITY % periodAttrs ''>
<!ENTITY % appinfoAttrs ''>
<!ENTITY % documentationAttrs ''>


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


<!-- Define some entities for informative use as attribute types -->
<!ENTITY % URIref "CDATA">
<!ENTITY % QName "CDATA">
<!ENTITY % NCName "NMTOKEN">
<!ENTITY % non-negative-integer "NMTOKEN">
<!ENTITY % boolean "(true|false)">
<!ENTITY % simpleDerivationChoice "(list|restriction|reproduction)">
<!ENTITY % simpleDerivationSet "CDATA">
      <!-- #all or space-separated list drawn from derivationChoice -->

<!-- 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 %simpleType; ((%annotation;)?,(%facet;)*)>
<!ATTLIST %simpleType;
    name      %NCName;                 #IMPLIED
    base      %QName;                  #REQUIRED
    abstract  %boolean;                'false'
    final     %simpleDerivationSet;    ''
    derivedBy %simpleDerivationChoice; 'restriction'
    %simpleTypeAttrs;>
<!-- name is required at top level -->

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

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

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

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

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

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

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

<!-- 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; | %documentation;)*>

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

C Datatypes and Facets

C.1 Fundamental Facets

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

  Datatype ordered bounded cardinality numeric
primitive string yes none countably infinite no
boolean no none finite no
float yes yes finite yes
double yes yes finite yes
decimal yes no countably infinite yes
timeInstant yes no countably infinite no
timeInstant yes no countably infinite no
recurringInstant yes no countably infinite no
binary no no countable infinite no
uri-reference no no countably infinite no
ID no no countably infinite no
IDREF no no countably infinite no
IDREFS no no countably infinite no
ENTITY no no countably infinite no
ENTITIES no no countably infinite no
NOTATION no no countably infinite no
derived
language no no countably infinite no
NMTOKEN no none countably infinite no
NMTOKENS no no countably infinite no
Name no no countably infinite no
QName no no countably infinite no
NCName no no countably infinite no
integer yes no countably infinite yes
non-positive-integer yes yes countably infinite yes
negative-integer yes yes countably infinite yes
long yes yes finite yes
int yes yes finite yes
short yes yes finite yes
byte yes yes finite yes
non-negative-integer yes yes countably infinite yes
unsigned-long yes yes finite yes
unsigned-int yes yes finite yes
unsigned-short yes yes finite yes
unsigned-byte yes yes finite yes
positive-integer yes yes countably infinite yes
date yes no countably infinite no
time yes no countably infinite no

C.2 Constraining Facets

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

length applies to the following datatypes:

minlength applies to the following datatypes:

maxlength applies to the following datatypes:

pattern applies to the following datatypes:

enumeration applies to the following datatypes:

maxInclusive applies to the following datatypes:

maxExclusive applies to the following datatypes:

minInclusive applies to the following datatypes:

minExclusive applies to the following datatypes:

precision applies to the following datatypes:

scale applies to the following datatypes:

encoding applies to the following datatypes:

period applies to the following datatypes:

D ISO 8601 Date and Time Formats

D.1 ISO 8601 Conventions

Three primitive datatypes described above, timeInstant, timeInstant, and recurringInstant, and two derived dataypes, date and time 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.

  • T -- is used as time designator to indicate the start of the representation of the time of day in timeInstant and recurringInstant. It is also used to to indicate the start of the representation of the time-units for hour, minutes, seconds and fractional seconds in timeInstant.
  • Z -- is used as time-zone designator, immediately (without a space) following a data element expressing the time of day in Coordinated Universal Time (UTC) in timeInstant, recurringInstant, and time

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 datatype uses a truncated format for timeInstant to indicate recurring instants of time. In fact, only recurring instants that can be represented truncated representations of timeInstant are permitted.

Left truncated representations are also allowed for the date 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 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 and timeInstant.

D.3.2 More Than 9999 Years

To accommodate year values greater than 9999, more than four digits are allowed in the year representations of timeInstant, timeInstant and time. This follows the [ISO 8601 Draft Revision].

E Regular Expressions

A regular expression R is a sequence of characters that denotes a set of strings L(R). When used to constrain the lexical space of a datatype, a regular expression R asserts that only strings in L(R) are valid specifications for values of that type.

[Definition:]  A regular expression is composed from one or more branches, separated by | characters.

For all branches S, and for all regular expressions T, valid regular expressions R are: Denoting the set of strings L(R) containing:
S all strings in L(S)
S|T all strings in L(S) and all strings in L(T)

[Definition:]  A branch consists of zero or more pieces, concatenated together.

For all pieces S, and for all branches T, valid branches R are: Denoting the set of strings L(R) containing:
S all strings in L(S)
ST all strings st with s in L(S) and t in L(T)

[Definition:]  A piece is an atom, possibly followed by a quantifier.

For all atoms S, valid pieces R are: Denoting the set of strings L(R) containing:
S all strings in L(S)
S? the empty string, and all strings in L(S).
S* All strings st with s in L(S?) and t in L(S*). ( all concatenations of zero or more strings from L(S) )
S+ All strings st with s in L(S) and t in L(S*). ( all concatenations of one or more strings from L(S) )

[Definition:]  An atom is either a normal character, a character class, or a parenthesized regular expression.

For all normal characters c, character classes C, and regular expressions S, valid atoms R are: Denoting the set of strings L(R) containing:
c the single string consisting only of c
C all strings in L(C)
(S) all strings in L(S)

[Definition:]  A quantifier is is either ?, *, or +.

[Definition:]  A metacharacter is either ., \, ?, *, +, (, ), [, or ]. These characters have special meanings in regular expressions, but can be escaped to form atoms that denote the sets of strings containing only themselves, i.e., an escaped metacharacter behaves like a normal character.

[Definition:]  A normal character is any XML character that is not a metacharacter. In regular expressions, a normal character is an atom that denotes the singleton set of strings containing only itself.

E.1 Character Classes

[Definition:]  A character class is an atom R that identifies a set of characters C(R). The set of strings L(R) denoted by a character class R contains one single-character string "c" for each character c in C(R).

A character class is either a character class escape or a character class expression.

[Definition:]  A character class expression is a character group surrounded by [ and ] characters. For all character groups G, [G] is a valid character class expression, identifying the set of characters C([G]) = C(G).

[Definition:]  A character group is either positive character group, a negative character group, or a character class subtraction.

[Definition:]  A positive character group consists of one or more character ranges or character class escapes, concatenated together. A positive character group identifies the set of characters containing all of the characters in all of the sets identified by its constituent ranges or escapes.

For all character ranges R, all character class escapes E, and all positive character groups P, valid positive character groups G are: Identifying the set of characters C(G) containing:
R all characters in C(R).
E all characters in C(E).
RP all characters in C(R) and all characters in C(P).
EP all characters in C(E) and all characters in C(P).

[Definition:]  A negative character group is a positive character group preceded by the ^ character. For all positive character groups P, ^P is a valid negative character group, and C(^P) contains all XML characters that are not in C(P).

[Definition:]  A character class subtraction is a character class expression subtracted from a positive or negative character group, using the - character.

For any positive or negative character group G, and any character class expression C, G-C is a valid character class subtraction, identifying the set of all characters in C(G) that are not also in C(C).

[Definition:]  A character range R identifies a set of characters C(R) containing all XML characters with Unicode code points in a specified range.

A single XML character is a character range that identifies the set of characters containing only itself. All XML chacters are valid character ranges, except as follows:

A character range may also be written in the form s-e, identifying the set that contains all XML characters with Unicode code points greater than or equal to the code point of s, but not greater than the code point of e.

s-e is a valid character range iff:

NOTE: The code point of a single character escape is the code point of the single character in the set of characters that it identifies.

E.1.1 Character Class Escapes

[Definition:]  A character class escape is a short sequence of characters that identifies predefined character class. The valid character class escapes include the single character escapes, the multi-character escapes, and the category escapes.

[Definition:]  A single character escape identifies a set containing a only one character -- usually because that character is difficult or impossible to write directly into a regular expression.

The valid single character escapes are: Identifying the set of characters C(R) containing:
\n the newline character (&#xA;)
\r the return character (&#xD;)
\t the tab character (&#x9;)
\\ \
\. .
\- -
\^ ^
\? ?
\* *
\+ +
\( (
\) )
\[ [
\] ]

[Definition:]  The Unicode Standard [Unicode] defines a number of character properties and provides mappings from code points to specific character properties. The set containing of all characters that have property X, may be identified with a category escape \p{X}. The compliment of this set may be specified with the category escape \P{X}. ([\P{X}] = [^\p{X}]).

The following table specifies the main character properties (for more information, see Chapter 4 of [Unicode]).

CategoryPropertyMeaning
LettersLAll Letters
LuUppercase
LlLowercase
LtTitlecase
LmModifier
LoOther
 
MarksMAll Marks
MnNon-Spacing
McSpacing Combining
MeEnclosing
 
NumbersNAll Numbers
NdDecimal Digit
NlLetter
NoOther
 
PunctuationPAll Punctuation
PcConnector
PdDash
PsOpen
PeClose
PiInitial quote (may behave like Ps or Pe depending on usage)
PfFinal quote (may behave like Ps or Pe depending on usage)
PoOther
 
SeparatorsZAll Separators
ZsSpace
ZlLine
ZpParagraph
 
SymbolsSAll Symbols
SmMath
ScCurrency
SkModifier
SoOther
 
OtherCAll Others
CcControl
CfFormat
CsSurrogate
CoPrivate Use
CnNot Assigned

[Definition:]  A multi-character escape provides a simple way to identify a commonly used set of characters:

Character Sequence Equivalent character class
.[^\n\r]
\s[&#x20;\t\n\r]
\S[^\s]
\i[\p{L}\p{Nl}:_]
\I[^\i]
\c[\p{?}\p{?}]
\C[^\c]
\d\p{Nd}
\D[^\d]
\w[\p{?}\p{?}]
\W[^\w]

F References

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
XML Information Set
World Wide Web Consortium. XML Information Set (public WD) Available at: http://www.w3.org/TR/xml-infoset
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: http://www.w3.org/TR/2000/WD-xmlschema-1-20000225/
XML Schema Requirements
XML Schema Requirements. Available at: http://www.w3.org/TR/NOTE-xml-schema-req
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).
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
Namespaces in XML
World Wide Web Consortium. Namespaces in XML. Available at: http://www.w3.org/TR/REC-xml-names/
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
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 1766
H. Alvestrand, ed. RFC 1766: Tags for the Identification of Languages 1995. Available at: http://www.ietf.org/rfc/rfc1766.txt

F.2 Non-normative

Unicode Regular Expression Guidelines
Mark Davis. Unicode Regular Expression Guidelines, 1988. Available at: http://www.unicode.org/unicode/reports/tr18/
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
SQL
SQL Standard. See http://www.jcc.com/SQLPages/jccs_sql.htm
Clinger, WD (1990)
William D Clinger. How to Read Floating Point Numbers Accurately. In Proceedings of Conference on Programming Language Design and Implementation, pages 92-101. Available at: ftp://ftp.ccs.neu.edu/pub/people/will/howtoread.ps
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.
ISO 11404
ISO (International Organization for Standardization). Language-independent Datatypes. See http://www.iso.ch/cate/d19346.html
RDF Schema
World Wide Web Consortium. RDF Schema Specification. Available at: http://www.w3.org/TR/PR-rdf-schema/
XSL
World Wide Web Consortium. Extensible Stylesheet Language (XSL). Available at: http://www.w3.org/TR/xsl/

G Acknowledgments (non-normative)

The following have contributed material to this draft:

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 Lotus Development Corp. and IBM for providing teleconferencing facilities.

The current members of the XML Schema Working Group are:

David Beech, Oracle Corp.; Paul V. Biron, Health Level Seven; Don Box, DevelopMentor; Allen Brown, Microsoft; Greg Bumgardner, Rogue Wave Software; Lee Buck, Extensibility; Charles Campbell, Informix; 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; Andrew Layman, Microsoft; Dmitry Lenkov, Hewlett Packard Company; Eve Maler, Sun Microsystems; Ashok Malhotra, IBM; Murray Maloney, Commerce One; John McCarthy, Lawrence Berkeley National Laboratory; Noah Mendelsohn, Lotus Development Corporation; Don Mullen, Extensibility; Frank Olken, Lawrence Berkeley National Laboratory; Dave Peterson, Graphic Communications Association; Mark Reinhold, Sun Microsystems; 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; Asir Vedamuthu, webMethods; Priscilla Walmsley, XMLSolutions; Norm Walsh, ArborText, Inc.; 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.

Paula Angerstein, Vignette Corporation; Gabe Beged-Dov, Rogue Wave Software; Dean Burson, Lotus Development Corporation; George Feinberg, Object Design; Charles Frankston, Microsoft; Ernesto Guerrieri, Inso; Michael Hyman, Microsoft; Setrag Khoshafian, Technology Deployment International (TDI); Janet Koenig, Sun Microsystems; Ara Kullukian, Technology Deployment International (TDI); Murata Makoto, Xerox; Chris Olds, Wall Data; Shriram Revankar, Xerox; William Shea, Merrill Lynch; Ralph Swick, W3C; Tony Stewart, Rivcom

H Open Issues

idref-subtype-of-id

I Revisions from Previous Draft

  1. 2000-02-08: pvb: spell check
  2. 2000-02-08: pvb: added COS's for interaction between min/max-X facets
  3. 2000-02-08: pvb: changed datatype of length, min/maxlength facets from positive-integer to non-negative-integer
  4. 2000-02-08: pvb: corrected typo in date-lexical-representaion, where a "specific century" was noted as YY (changed to CC)
  5. 2000-02-08: pvb: changed defn of atomic from being "intrinsically indivisible" to "regarded as indivisible by this specification"
  6. 2000-02-08: pvb: clarified defn of facet, wrt value spaces and not "concepts or objects"
  7. 2000-02-08: pvb: merged "terminology" sections from both part 1 and part 2
  8. 2000-02-08: pvb: fixed datatype of scale facet (from pos-int to non-neg-int)
  9. 2000-02-08: pvb: added "priority feedback note" for bigNums
  10. 2000-02-09: pvb: fixed circular defn of decimal, as suggested by DC
  11. 2000-02-09: pvb: added 1 and 0 to lexical space of boolean
  12. 2000-02-09: pvb: added subsections to section 4...this may get undone when I dump the abstract syntax, we'll see
  13. 2000-02-10: pvb: added pattern facet to all datatypes
  14. 2000-02-10: pvb: updated several incorrect values in the constraining facets "table" in Appendix C2.
  15. 2000-02-10: pvb: changed examples to use <documentation> instead of <info> as the child of <annotation>
  16. 2000-02-10: pvb: added the correct built-in datatypes namespace to section 3.1 (closes the datatypes portion of issue 78)
  17. 2000-02-10: pvb: changed examples to use <simpleType> instead of <datatype>, equivalent changes to the DTD and schema will come shortly closes the datatypes portion of issue 157)
  18. 2000-02-10: pvb: renamed uri datatype to uri-reference; clarified the defn wrt RFC 2396; included specific mention of absolute vs. relative uri-references; still need to be specific about the lexical representation (closes some parts of issue 212)
  19. 2000-02-15: pvb: added SVC to binary, which says one must give a value for the encoding facet (i.e., a hack to get around the problem that we don't have the concept of "required" facets) [part of the resolution to issue 81]
  20. 2000-02-15: pvb: moved ID to a primitive type (since it has validation requirements above and beyond those provided for subtypes of string). Also added a Note: to it making explicit the fact that the value space is scoped to an instance document (unlike the value space of types such as integer). Also fixed a bug in the definition, which refered to Name instead of NCName [part of the resolution to issue 81]
  21. 2000-02-15: pvb: moved IDREF to a primitive type (since it has validation requirements above and beyond those provided for subtypes of string). Added an issue about whether this could be generated from ID. Also added a Note: to it making explicit the fact that the value space is scoped to an instance document (unlike the value space of types such as integer). [part of the resolution to issue 81]
  22. 2000-02-15: pvb: moved IDREFS to a primitive type (since it has validation requirements above and beyond those provided for subtypes of string)....this is just a temporary home and it will become generated as list of IDREF when I get the list stuff implemented [part of the resolution to issue 81]
  23. 2000-02-15: pvb: moved ENTITY to a primitive type (since it has validation requirements above and beyond those provided for subtypes of string). Also added a Note: to it making explicit the fact that the value space is scoped to an instance document (unlike the value space of types such as integer). Also added a SVC that entity values must match a declared unparsed entity name. [part of the resolution to issue 81]
  24. 2000-02-15: pvb: moved ENTITIES to a primitive type (since it has validation requirements above and beyond those provided for subtypes of string)....this is just a temporary home and it will become generated as list of ENTITY when I get the list stuff implemented [part of the resolution to issue 81]
  25. 2000-02-15: pvb: moved NOTATION to a primitive type (since it has validation requirements above and beyond those provided for subtypes of string). Also added a Note: to it making explicit the fact that the value space is scoped to an instance document (unlike the value space of types such as integer). Also added a SVC that notation values must match a declared notation name. [part of the resolution to issue 81]
  26. 2000-02-15: pvb: updated table in appendix C1, to note that all datatypes are exact
  27. 2000-02-16: pvb: added i4, i8, u4, u8, etc. subtypes of integer, using editor's discretion in their naming as instructed at the berkeley f2f...changed the first example in section 4 "Defining Generated Datatypes" to use the Sku datatype from Part 0, instead of i4 since we now have i4 built-in
  28. 2000-02-16: pvb: removed issue: definition-overriding from the draft
  29. 2000-02-17: pvb: removed the exact vs. approximate distinction entirely (since all our types turned out to be exact)
  30. 2000-02-17: pvb: removed all mention of aggregate datatypes. Changed the "atomic vs. aggregate" dichotomy to be: atomic vs. list. [part of resolution to issue 112]
  31. 2000-02-17: pvb: clarified defns of value space and lexical space. In particular, moved the notion of a literal denoting a value from the defn to LS to VS and noted that a literal is a character information item from the info set.
  32. 2000-02-17: pvb: changed terminology of "generated" to "derived", to be in alignment with the structures spec [part of resolution to issue 204]
  33. 2000-02-17: pvb: removed definition of term subtype, changed all prose of the form "for subtypes of X" to "for datatypes derived from X" [part of resolution to issue 204]
  34. 2000-02-17: pvb: removed a para from Conformance section which mentioned processor option of turning off validation of certain facets
  35. 2000-02-17: pvb: removed note that order-relations are not defined
  36. 2000-02-17: pvb: made IDREFS, ENTITIES and NMTOKENS derived by list from IDREF, ENTITY and NMTOKENS respectively. [part of resolution of issue 81]
  37. 2000-02-17: pvb: clarified what the values {hex,base64} mean for the encoding facet
  38. 2000-02-17: pvb: added pointers from the 4 mechanisms to create a value space to the places in the spec where those mechanisms are described
  39. 2000-02-17: pvb: all built-in generated types are now defined in the schema for datatypes
  40. 2000-02-21: pvb: clarified list datatypes, wrt use of component type which allows whitespace in its literals and wrt facets applicable for deriving subtypes of a list type
  41. 2000-02-23: pvb: change defn of binary and meaning of length facet for binary to be measured in octets, since both lexical encodings are only defined for octet multiples.
  42. 2000-02-23: pvb: incorporated prose description of regex language (thanx to Matt Timmermans!!!!)
  43. 2000-02-23: pvb: added appinfo's to builtin definitions in the schema for datatypes, which are used to generate the list of constraining facets for each builtin datatype in the html version of the spec
  44. 2000-02-23: pvb: replaced abstract syntax with 2 new sections for "schema components" and "xml representation" constructs, still needs a lot of editorial work tho
  45. 2000-02-23: pvb: list of derived types for each built-in type is now auto-generated from the builtins.xsd
  46. 2000-02-23: pvb: appendix C.2 (list of datatypes to which each facet applies) is now auto-generated form the builtins.xsd
  47. 2000-02-24: pvb: put equality back in as a fundamental facet, to help with the vote on today's telcon regarding key, unique and keyref value matching.
  48. 2000-02-24: pvb: added 'datatype valid' validation constraint
  49. 2000-02-24: pvb: added stub for 'facet valid' validation constraint