Contained Element Name and Attribute Data Members
For each of the elements contained in a complex type, the class for the complex type has data members for the element names, and for any attributes of the complex type. The following code is taken from the XML Binding basic example:
<xsd:complexType name="PurchaseOrderType">
<xsd:sequence>
<xsd:element name="shipTo" type="USAddress"/>
<xsd:element name="billTo" type="USAddress"/>
<xsd:element ref="comment" minOccurs="0"/>
<xsd:element name="items" type="Items"/>
</xsd:sequence>
<xsd:attribute name="orderDate" type="xsd:date"/>
</xsd:complexType>
The class PurchaseOrderType contains the following static data members:
static const rwsf::XmlName OrderDateAttributeName;
static const rwsf::XmlName ShipToElementName;
static const rwsf::XmlName BillToElementName;
static const rwsf::XmlName CommentElementName;
static const rwsf::XmlName ItemsElementName;
The names of the data members for the element names may not exactly match the names of the classes that represent them. They do not have parent names prepended, and may be different when substitution groups are used (see
Substitution Groups).