Поделиться через


Attribute Groups

 

Attribute groups are useful for grouping together attributes.

Example

The following example creates an attribute group, testMethods.

<xs:attributeGroup name="testMethods" />
   <xs:attribute name="writeVisualBasicCode" use="required" />
   <xs:attribute name="blackbox" use="optional" />
   <xs:attribute name="writeScriptCode" use="required" />
</xs:attributeGroup>

Referencing a Global Attribute Group Declaration

If you want to reference the group of attributes for a full name on an element, you must add a reference to it using the ref attribute of the attributeGroup element.

Example

The following example references a global attribute group, testMethods.

<xs:element name="testSuite">
   <xs:complexType>
      <xs:attributeGroup ref="testMethods" />
   </xs:complexType>
</xs:element>