I have a XSD that defined various complex types, which contains another complex type. The issue is that the inner complex type are exactly the same, but they are not defined as separated type, and therefore I have an inner classes for each top level class. The XSD is as follows:
<xs:complexType name="DOCTRACKTCSCREATEType">
<xs:sequence>
<xs:element name="DESCRIPTION" type="xs:string" minOccurs="0"/>
<xs:element name="gATTRIBNAME" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="mATTRIBNAME" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ATTRIBNAME" type="xs:string" minOccurs="0"/>
<xs:element name="ATTRIBVALUE" type="xs:string" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="m" type="xs:positiveInteger"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="g" type="xs:positiveInteger"/>
</xs:complexType>
</xs:element>
<xs:attribute name="id" type="xs:string"/>
</xs:complexType>
<xs:complexType name="DOCTRACKType">
<xs:sequence>
<xs:element name="REFERENCE" type="xs:string" minOccurs="0"/>
<xs:element name="gATTRIBNAME" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="mATTRIBNAME" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ATTRIBNAME" type="xs:string" minOccurs="0"/>
<xs:element name="ATTRIBVALUE" type="xs:string" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="m" type="xs:positiveInteger"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="g" type="xs:positiveInteger"/>
</xs:complexType>
</xs:element>
<xs:attribute name="id" type="xs:string"/>
</xs:complexType>
So both define an identical type gATTRIBNAME. I cannot change the XSD, but is there any other way I can have them create the same java class?