Datatypes in XML Schemas

One of the most promising new features of XML Schemas is the ability to specify datatypes for your elements and attributes. Datatypes are commonly used in programming languages and in databases to enforce data integrity by requiring the data stored to be of a certain type—for example, by forcing number to be only integers, or to have only two decimal places. XML Schemas introduce datatypes into XML with the second part of the XML Schema Recommendation: Datatypes.

What Is a Datatype?

There are really two broad divisions among the users of XML. First, there is the document camp. Those users are using XML to create structured documents in a format, which we all think of as a “document”—that is, large blocks of text, such ...

Get Special Edition Using XML, Second 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.