| Workshops --> XML --> Demo --> schema6.html |
|---|
![]() |
|
Custom simple types combine features from existing datatypes and provide more control over the specification of content of elements in the schema
Custom simple types are defined globally and can be reused throughout the schema
The generic form is
The name that is referenced in the opening declaration is the name of the simpleType and not the element in which it will be used
An example is
The xsd:restriction base is used to specify the datatype that will be used as the basis for the custom simple type
Once this custom simple type has been defined, it can be used in the definition of other elements in the schema
It has been named (statusType) and can be called by that name anywhere in the schema
This is how it would be used in the XML file to restrict the range of acceptable content
So because the range of content has been specified in the custom simple type, this is not acceptable
An example is
Notice that this anonymous custom simple type has been linked specifically to an element
Using this anonymous custom simple type, these are all acceptable in the XML document
This is not acceptable
|
||||||||||||||||||||||||
| Page by Howard Rosenbaum | |
| Find me at hrosenba@indiana.edu | You are here: http://www.slis.indiana.edu/hrosenba/www/Workshops/XML/Demo/schema6.html |