Appendix F. XML Schema Datatypes Reference

This appendix provides a quick reference to the W3C Recommendation for XML Schemas, Part 2: Datatypes. Datatypes were separated into a specification in their own right so that XML Schemas as well as other XML-related technologies (for example, RELAX NG) can use them.

The XML Schema defines several datatypes that can be used to validate the content of attributes and text-only elements. These datatypes enable you to specify that the content must be formatted as a date, a Boolean, a floating-point number, and so on. The second part of the XML Schema Recommendation defines two sorts of datatype:

  • Built-in types which are available to all XML Schema authors, and should be implemented by a conforming processor

  • User-derived types, which are defined in individual schema documents, and are particular to that schema (although it is possible to import and reuse these definitions in other XML Schemas). These types are based on the existing built-in types.

Built-in types include two subgroups:

  • Built-in primitive types, which are types in their own right. They are not defined in terms of other datatypes. Primitive types are also known as base types because they are the basis from which all other types are built.

  • Built-in derived types, which are built from definitions of other primitive and derived datatypes

The first part of this appendix provides a quick overview of all the XML built-in datatypes, both primitive and derived. The second part provides details ...

Get Beginning XML, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.