Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XML Schema simpleType Element

XML Schema simpleType Element


XML Schema Reference Manual Complete XML Schema Reference Manual


Definition and Usage

The simpleType element defines a simple type, specifying information about and constraints on the values of elements or attributes with plain text content.

Element Information

Syntax

id=ID

name=NCName

any attributes

(annotation?,(restriction|list|union))

(The ? symbol declares that the element can appear zero or one time within the simpleType element.)

property Description
id Optional. Specifies a unique ID for the element.
name

Type name. The name must be a no-colon name (NCName) as defined in the XML Namespaces specification.

If specified, the 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 not allowed at other times.

any attributes Optional. Specifies any other attributes with a non-schema namespace.

Example 1

This example declares the "age" element as a simple type with a constraint. The value of age cannot be less than 0 or greater than 100:

  xs:simpleType

    

      

      

    

  


XML Schema Reference Manual Complete XML Schema Reference Manual