users@jaxb.java.net

Found problem in <xjc:treatRestrictionLikeNewType />

From: VanIngen, Erik (FIPS) <"VanIngen,>
Date: Wed, 10 Aug 2011 17:28:54 +0200

Hi all,

My xsd has a type hierarchy with restriction from CodeType, through ItemType, to ItemBaseType. The latter defines the id. When using <xjc:treatRestrictionLikeNewType />, CodeType is losing id. Is this a known bug? Is there a solution for this?

The xsd cannot be changed since it is a third party artifact. The <xjc:treatRestrictionLikeNewType /> is used in my custom binding in order to generate friendly mapping classes.

Kind Regards,
Erik



<xs:complexType name="CodeType">
                <xs:complexContent>
                        <xs:restriction base="ItemType">
..................


        <xs:complexType name="ItemType" abstract="true">
                <xs:complexContent>
                        <xs:extension base="ItemBaseType">
......................


        <xs:complexType name="ItemBaseType" abstract="true">
                <xs:complexContent>
                        <xs:restriction base="NameableType">
                                <xs:sequence>
.............................................................................
                                </xs:sequence>
                                <xs:attribute name="id" type="common:IDType" use="required"/>
                        </xs:restriction>
                </xs:complexContent>
        </xs:complexType>