TOC PREV NEXT INDEX


Element Extension


The general mapping for complexContent with an extension element group is as follows:
XSD type:
<xsd:complexType name="TypeName">
 
   <xsd:complexContent>
 
      <xsd:extension base="BaseType">
 
         <xsd:group>
 
            <xsd:element name="elem1" type="Type1"/>
 
            <xsd:element name="elem2" type="Type2"/>
 
            ...
 
            <xsd:element name="elemN" type="TypeN"/>
 
         </xsd:group>
 
      </xsd:extension>
 
   </xsd:complexContent>
 
</xsd:complexType>
 

 
Generated C code:
typedef struct TypeName_1x2 {
group type definition..
} TypeName_1x2;
 
typedef struct TypeName {
BaseType base;
TypeName_1x2 ext;
} TypeName;
 
Generated C++ code:
class TypeName : public BaseType {
public:
group type definition..
} ;


Notes:
1. group in the extension group definition above can be any content model group type (sequence, all, choice, or group).
2. In the case of C, the extension group is pulled out to form the temporary type (TypeName_1x2). The internals of this type depend on the content group type.
3. In the case of C++, the BaseType is extended to form a derived class. The contents of the extension group are then added directly to the body of the derived class.

Objective Systems, Inc.

102 Pickering Way, Suite #506
Exton, Pennsylvania 19341
http://www.obj-sys.com
Phone: (484) 875-9841
Toll-free: (877) 307-6855 (US only)
Fax: (484) 875-9830
info@obj-sys.com
TOC PREV NEXT INDEX