Title: Local defined elements with unique types

We have a schema that resembles the following:

        <xs:complexType name="Addr_Type">

                <xs:sequence>

                        <xs:element ref="AddrTypeCd" minOccurs="0"/>

                        <xs:element ref="Addr1" minOccurs="0"/>

                        <xs:element ref="Addr2" minOccurs="0"/>

                        <xs:element ref="City" minOccurs="0"/>

                        <xs:element ref="StateProvCd" minOccurs="0"/>

                        <xs:element ref="PostalCode" minOccurs="0"/>

                        <xs:element ref="Country" minOccurs="0"/>

                        <xs:element name="Extension" type="AddrExtension_Type" minOccurs="0"/>

                </xs:sequence>

                <xs:attribute name="id" type="xs:ID"/>

                <xs:attribute name="PreferredContactRef" type="xs:IDREF"/>

        </xs:complexType>

        <xs:complexType name="Person_Type">

                <xs:sequence>

                        <xs:element ref="FirstName"/>

                        <xs:element ref="LastName"/>

                        <xs:element ref="Address"/>

                        <xs:element ref="PhoneNumber" minOccurs="0"/>

                        <xs:element name="Extension" type="PersonExtension_Type" minOccurs="0"/>

                </xs:sequence>

        </xs:complexType>

Notice that each type has an element named Extension, but each has a different type.  When I run it through Castor, it creates the first Extension class and names it Extension, but then when it gets to the second one, it creates a new Extension class and overwrites the first one. 

Is there a way to prevent that from occurring?

Jim


Reply via email to