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 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.