NIST conformance test suite for XMLSchema Part 2: Datatypes.

The National Institute of Standards and Technology

September 25, 2001

Summary

This is a conformance test suite for XML Schema built-in simple datatypes, as defined in W3C Recommendation XML Schema, Part 2: Datatypes of May 02, 2001.

How to access the tests.

Test Descriptions

Detailed descriptions of the tests for each datatype are available through the following links:

Primitive datatypes
anyURI base64Binary boolean date dateTime decimal
double duration float gDay gMonth gMonthDay
gYear gYearMonth hexBinary QName string time

Derived datatypes
byte ID int integer language long
Name NCName NMTOKEN negativeInteger nonNegativeInteger nonPositiveInteger
normalizedString positiveInteger short token unsignedByte unsignedInt
unsignedLong unsignedShort

Overview of the test suite

Objectives

The objective of this test suite is to provide a collection of conformance tests for the built-in simple datatypes defined in the W3C Recommendation for XML Schema Part 2: Datatypes. All the built-in primitive datatypes are represented, as are all the built-in derived datatypes whose derivation is by restriction and which may appear alone in an instance document with no internal or external references to entities other than a defining schema document and the XML Schema namespace for instances.

Scope

The scope of this test suite covers all built-in primitive datatypes, as well as all built-in derived datatypes which satisfy the following conditions:

1. Derivation is by restriction, and

2. A value of the datatype may appear alone in an instance document with no internal or external references to entities other than a defining schema document and the XML Schema namespace for instances.

All constraining facets defined in the Recommendation are tested against the types to which they apply.

Form

The form of the tests is as follows: for each built-in datatype, for each applicable constraining facet, a number of schemas are provided. Each schema defines a new type by restricting the built-in type by some value of the facet. For each of these schemas, a number of instance documents are provided. Each instance contains a single value from within the value space defined by its defining schema.

In general, five schemas are provided for each valid type/facet combination. When it is not possible to derive five distinct restriction values for a particular type/facet combination (e.g. byte/totalDigits, where only three distinct values for totalDigits are permissible) the number of schemas will be fewer.

Five instances are provided for each schema except in those circumstances where the value space of the restricted type contains fewer than five distinct values (e.g. a type derived from byte with the facet maxExclusive == -127 has only one value in its value space).

For those facets which are scalar in nature, such as length, maxExclusive, totalDigits, etc., the upper and lower bounds on the value space as defined in the Recommendation are always tested in the provided schemas, and the upper and lower bounds on the restricted value space as defined in the provided schemas are always tested in the provided instances.

The tests in this collection contain only legal values of the lexical representations of datatypes, as defined in the Recommendation. For schema-conformant parsers, no errors should be expected in the processing of the provided tests.

Omissions

No tests are provided for the following built-in types, for reasons outlined above: IDREF; ENTITY; NOTATION; IDREFS; ENTITIES; NMTOKENS.

For built-in types double and float, the special values NaN, INF, -INF, -0 and 0 are not tested.

Intellectual Property Statement

This test suite was developed at the National Institute of Standards and Technology by employees of the Federal Government in the course of their official duties. Pursuant to title 17 Section 105 of the United States Code this test suite is not subject to copyright protection and is in the public domain.

Contact

John Tebbutt

The National Institute of Standards and Technology

tebbutt@nist.gov