Data Types Undefined in XML Schema? (1/2) - exploring XML | WebReference

Data Types Undefined in XML Schema? (1/2) - exploring XML

Data Types Undefined in XML Schema?

The XML Schema Working Group was tasked with adding the two most important pieces to the XML puzzle: Schema Definitions and a Data Type Libary. Criticism rises now as more and more people work with the resulting specifications, including XML Schema part 2: Datatypes.

The goal for a data type library is to provide strong typing to the value of text nodes, so that rules for XML documents can be defined not only for tag structures but also for the text between them. Contracts can be created for a systematic data exchange between systems that enable new levels of interoperability and automation.

Unsatisfied Requirements

Unassuming as I am, I would expect the following requirements to be met in such a library:

  1. A minimal set of well-defined and complete primitive types, easy to understand and to implement.
  2. Consistent relations between types, expressing meaningful concepts such as precision, composition and the like.

A brief look at the data definitions leads to disappointing findings:


First and foremost, there is no concise definition of what is considered a primitive type, other than by enumeration.


19 of the 44 types are defined as primitives, which does not exactly sound minimal. Confirming our hunch, eight of the 19 primitive types are referring to time and date: date, time, dateTime, gYearMonth, gMonthDate, gYear, gMonth, gDay.


anyURI, which is indeed any Uniform Resource Identifier, is considered a primitive type. Strangely enough, it is neither a token, nor a normalized string or string. double is not related to the also existing type float, although it is defined as a double precision float. base64Binary and hexBinary are both encoded objects, but also have no relation.

Even worse, the eight date types mentioned above are not related to each other in any way, either!


Not a single scientific data type such as a complex number has made it into the spec. While they can be user-defined, one wonders why long-standing efforts in high-precision math since the days of Fortran have been ignored. Even less academic subject matter such as sister XML specifications have been ignored: For instance, there is no way to define an element or attribute to be of type XPath.


With composite types such as lists and dates, semantics are expressed by position rather than tag structure. This is going against the spirit of XML.

More concerns...

Produced by Michael Claßen

Created: Aug 05, 2002
Revised: Aug 05, 2002