To create a local type, simply include the type declaration as a child of the element:
Using a Global Type for Attribute
You can create a global definition.
Within your attribute declarations, you can refer to a global type by name.
This type can be one of the built-in XML Schema datatypes.
Referring to an Existing Global Attribute