Attribute Groups
HydraExpress supports attribute groups. HydraExpress does not generate a class for the attribute groups since attributes can only be simple types. Instead it expands the attribute group in the complex type definition that is referencing the attribute group. An example of the mapping for this is shown in example below:
<schema xmlns=""
<element name="Book">
<group ref="tns:BookElements"/>
<attributeGroup ref="tns:BookAttributes"/>
<group name="BookElements">
<element name="Title" type="string" minOccurs="1"
<element name="Author" type="string" minOccurs="1"
<element name="Date" type="string" minOccurs="1"
<element name="ISBN" type="string" minOccurs="1"
<element name="Publisher" type="string" minOccurs="1"
<attributeGroup name="BookAttributes">
<attribute name="CoverType" type="string"/>
<attribute name="Height" type="float"/>
<attribute name="Width" type="float"/>
<attribute name="NumberOfPages" type="int"/>
Only one complex type is defined in the schema, so only one class is generated: Book. This class would contain the following methods:
*[get|set]CoverType(), [is|set]CoverTypeSet()
*[get|set]Height(), [is|set]HeightSet()
*[get|set]Width(), [is|set]WidthSet()
*[get|set]NumberOfPages(), [is|set]NumberOfPagesSet()
Attributes, as previously noted, are always simple types, so HydraExpress does not generate a class for them, or for the attribute group. The attributes in the attribute group are treated like any other attributes, with accessor methods and is...Set() and set...Set() methods for determining whether an attribute is present in the instance document.