Class Stereotypes
You can define one of the following stereotypes for a class:
• Schema group
• Expression
• Enumeration
• Structure (XSD)
Defining a Class Stereotype
To define a stereotype:
1. Open the Properties dialog box of the tag (or class) definition.
2. Click the Characteristics tab.
3. In the Stereotype list box, select "Schema Group", "Enumeration" or "Expression" using the arrow.
Schema Group Stereotype

A class of the
Schema Group stereotype represents an ordered group or a subset of a set of elements or attributes.
The possible orders for a group are:
All/ type elements can appear zero or one times and in any order. "All" groups are only authorized at the highest level of a type and must appear alone. In addition, they can only contain elements.
Sequence: the elements are declared in the order they are defined in the group.
Choice: only one element of the group can be declared.
None: no order is applied.
These ordering options are combined with the values of the multiplicities.
Expression Stereotype
Classes of the Expression stereotype are used to define variants of primitive types. They are based on the standard types provided (Standard::Types::XML::XSD package).
Enumeration Stereotype
Classes of the Enumeration stereotype are used to define a set of values. These classes can be used as an attribute type, or even an element type when the schema language allows (such as XSD). Attributes based on such a type can only assume the values defined by the Enumeration class.

It is recommended that
Enumeration types be declared locally in a class C that defines the attributes based on these types. This recommendation only applies when the type is not reused by other attributes external to class C. This avoids proliferation of types in the package and allows reusing the same names for similar concepts.
Example
The "Magazine" class has an attribute called "Frequency". This attribute is based on the "Frequency" type of the "Enumeration" stereotype. The possible values are therefore "monthly", "weekly", "semimonthly", and "quarterly".
As described in the above recommendation, the "Frequency" class is declared locally in the "Magazine" class.
XSD
<xsd :simpleType name='FrequencyMagazine'>
<xsd:restriction base='xsd:string'>
<xsd:enumeration value="monthly"/>
<xsd:enumeration value="weekly"/>
<xsd:enumeration value="semimonthly"/>
<xsd:enumeration value="quarterly"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:ComplexType name="Magazine">
<xsd:complexContent>
<xsd:extension base='book'>
<xsd:sequence>
<xsd:element name="Summary" type="Summary" minOccurs="1" maxOccurs="1"/>
<xsd:element name="BookSummary" type="BookSummary" minOccurs="0" maxOccurs="*"/>
</xsd:sequence>
<xsd:attribute name="Frequency" type="FrequencyMagazine" use="Required"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Structure Stereotype (XSD)
Classes of
Structure stereotype are used to define unions of types. This stereotype is specific to XSD. See
“Union definition", page 50.