Appendix B. XML Schema Basics

The XML Schema specification is long and complex. To create SOAP and WSDL XML, you must know how XML Schema specify data types. This appendix is a quick introduction to the topic, with examples. You won't come away a Schema guru; you will be able to follow WSDL.

Simple and Complex Types

In an XML Schema, all data types are either primitive or derived. A primitive data type is one that cannot be expressed in terms of any other data type. The XML Schema specification gives the example of a float, "a well-defined mathematical concept that cannot be defined in terms of other data types," where an integer is a derivative of decimal data type. In this case, a float is primitive and an integer is derived.

All primitive data types are atomic . That is, the value of the data type cannot be broken down any more than it already is. For example, the number 1 is an atomic value.Derived data types may or may not be atomic. For example, an integer as we have already seen is a derived data type that has an atomic value. A telephone number, however, is also a derived data type whose value is not atomic; it is actually a collection of three individual atomic values.

Data types are mainly derived through restriction or extension (there are other ways, but these are the most common). In derivation through restriction, the value of the data type is restricted in some way. For example, an integer is a derivation of the decimal data type that allows for a narrower range ...

Get Programming Web Services with SOAP 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.