users@jaxb.java.net

RE: Found problem in <xjc:treatRestrictionLikeNewType />

From: VanIngen, Erik (FIPS) <"VanIngen,>
Date: Thu, 18 Aug 2011 18:00:11 +0200

Thank you, I have filed it as a bug:
http://java.net/jira/browse/JAXB-855


From: Martin Grebac [mailto:martin.grebac_at_oracle.com]
Sent: 11 August 2011 17:22
To: users_at_jaxb.java.net
Subject: Re: Found problem in <xjc:treatRestrictionLikeNewType />

Hi,
 seems like a bug, please file an issue with reproducible testcase,
  MartiNG

On 08/10/2011 05:28 PM, VanIngen, Erik (FIPS) wrote:
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>




--
Martin Grebac, GlassFish/Metro/JAXB/Tooling at Oracle
http://blogs.sun.com/mgrebac
ICQ: 93478885