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 simpleType and complexType elements. It is required if the simpleType element is a child of the schema element, 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: