Attributes are declared using the attribute element.
The following example shows an attribute declaration for blue
.
<xs:attribute name="blue" />
You can define attributes globally and use the ref attribute to reference global attributes.
The following example shows a reference to the global attribute, blue
.
<xs:element name="eyeColor" type="eyeColorType" /> <xs:complexType name="eyeColorType"> <xs:attribute ref="blue" /> <xs:attribute name="light" /> </xs:complexType>
The following example shows another reference to the global attribute, blue
.
<xs:element name="contactLense" type="contactLenseType" /> <xs:complexType name="ContactLenseType" /> <xs:attribute ref="blue" /> </xs:complexType>