XML Schema simpleType Element
Definition and Usage
The simpleType element defines a simple type, specifying information and constraints related to the values of elements or attributes that contain plain text content.
Element Information
- Parent Elements: attribute, element, list, restriction, schema, union
Syntax
(? The symbol indicates that the element can appear zero or one time within the simpleType element.)
| Attribute | Description | 
|---|---|
| id | Optional. Specifies a unique ID for the element. | 
| name | The type name. This name must be a colon-less name (NCName) as defined in the XML namespace specification. If specified, this name must be unique among all simpleTypeandcomplexTypeelements. It is required if thesimpleTypeelement is a child of theschemaelement, and it is not allowed otherwise. | 
| any attributes | Optional. Specifies any other attributes with non-schema namespaces. | 
Example 1
This example declares the "age" element as a simple type with constraints. The value of age cannot be less than 0 or greater than 100: