Purpose | This element enables you to define a simple data type in the Tamino Schema Language. |
Parent element | xs:attribute ,
xs:element ,
xs:list ,
xs:schema (only in the
case of named types), xs:union |
Child elements | xs:list , xs:restriction ,
xs:union |
Attributes | final ,
name |
Name | Type | Description |
---|---|---|
final |
This attribute, in conjunction with the
xs:schema element's
Alternatively, the special value "#all" prevents all methods of deriving a new type from the current simple type definition. |
|
name |
xs:NCName |
For purposes of reuse, it is possible to specify a name for a
simple type definition to be able to reference it later by this name. This is
done with the This attribute is mandatory for the definition of named simple types. For anonymous simple types, however, it must be omitted. |
This example defines a simple type based on a restriction that only the three values "instrumentalist", "jazzSinger" and "jazzComposer" are allowed for the defined type:
<xs:schema xmlns:xs = "http://www.w3.org/2001/XMLSchema" xmlns:tsd = "http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition"> . . . <xs:simpleType name="role"> <xs:restriction base = "xs:NMTOKEN"> <xs:enumeration value = "instrumentalist"/> <xs:enumeration value = "jazzSinger"/> <xs:enumeration value = "jazzComposer"/> </xs:restriction> </xs:simpleType> . . . </xs:schema>
Here is another example showing anonymous simple type definitions:
<xs:element name = "price"> <xs:simpleType> <xs:restriction base='decimal'> <xs:totalDigits value='9'/> <xs:fractionDigits value='2'/> </xs:restriction> </xs:simpleType> </xs:element>