Download Delve® SOA Fast-Prototyping Toolkit (Beta 1.0)
| Tutorials - How To Define a Simple XML-Schema Data Type |
Page 1 of 2 |
In the lesson “How to Define an XML-Schema Data Type” we took at how to define complex data types based on the XML-Schema specification. This lesson focuses on definition of simple types.
The most common sort of simple type definition is called a restriction, in which we taken one of the basic XML-Schema types and declare limitations (called “facets”) on the values it can be assigned. Let’s suppose we want to represent the height of adult humans in feet and inches. We must first define a simple type that contains the “feet” part of the representation.

Simple type definitions that are restriction-based always start with the keyword “simpleType,” followed the name of the type being defined and the keyword “restriction.” In this case, there are two facets, one designating the smallest allowable value of the content and one designating the largest allowable value of the content. In this way, we define a person’s height as ranging from three to nine feet.
Next, let’s define the “inches” part of our height representation. It’s also a restriction.

|
|
|