users@jaxb.java.net

xjc class generation: how to force XMLRootElement on a XSD element?

From: VanIngen, Erik (FIPS) <"VanIngen,>
Date: Wed, 29 Dec 2010 13:42:17 +0100

Dear Jaxb,

I generated classes with XJC from a set of 55 xsd files:
http://www.fao.org/figis/sdmx/sdmx21xsd/index.html

The generation of classes with XJC runs fine. The problem is that the class generated for GenericData does not have the @XMLRootElement annotation.
My questions are
(1) Why does GenericData not have a @XMLRootElementAnnotation?
(2) How can I force GenericData having the @XMLRootElement annotation?


The xjb binding file has, amongs others, this definition:
<jaxb:globalBindings xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
 generateIsSetMethod="false" generateElementClass="true">
        <xjc:simple />
</jaxb:globalBindings>

One of the xsd's,
http://www.fao.org/figis/sdmx/sdmx21xsd/SDMXMessage.xsd , has the element GenericData:
        <xs:element
                name="GenericData"
                type="GenericDataType">
        </xs:element>


GenericDataType is used by GenericData and by GenericTimeSeriesDataType:
        <xs:complexType
                name="GenericTimeSeriesDataType">
                <xs:complexContent>
                        <xs:restriction
                                base="GenericDataType">
                                ................................
                        </xs:restriction>
                </xs:complexContent>
        </xs:complexType>


Kind Regards,
Erik van Ingen