Chapter 10. Defining Simple Types

In XML Schema, an element defined as a simple type can contain only text. In other words, it cannot have attributes or child elements. However, it’s a little misleading to say it can only contain text. Rather, it’s more accurate to say that it can only contain a value, because with XML Schema, you can declare that it can contain a particular kind of text. In other words, you can declare that an element contain only numbers, or only dates, or only boolean values, etc.

XML Schema includes a large collection of built-in simple types for the most common kinds of text. These include strings, boolean values, URLs, various date and time formats, and numbers of all kinds.

You can also apply restrictions, or facets, to these ...

Get XML: Visual QuickStart Guide, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.