O'Reilly logo

XML: Visual QuickStart Guide, Second Edition by Kevin Howard Goldberg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required