An element of the complex type can have attributes.
A simple element can contain only its value.
XSD Attribute Example:
<xs:attribute name="power" type="xs:integer"/>
The following is an element with the attribute declared in the above example.
For data types, refer to Simple Element page
A default value is assigned when no value was specified.
<xs:attribute name="target" type="xs:string" default="single"/>
An attribute with a fixed value can't have any other value.
<xs:attribute name="target" type="xs:string" fixed="single"/>
A required attribute must appear in the element containing it.
<xs:attribute name="target" type="xs:string" use="required"/>