users@jaxb.java.net

Required while MinOccurs = 1

From: Bradley Rintoul <brintoul_at_sbcglobal.net>
Date: Thu, 6 Jul 2006 15:06:23 -0700 (PDT)

Hello:

I hope this hasn't been covered before... I am generating some Java classes from an XSD document using JAXB 2 and finding a rather curious attribute in my XmlElement annotations. For all of my XmlElements that involve collections I'm getting a "required = true" attribute thrown in when the XSD claims that minOccurs for that element is "0".


What could be going on here?

The XSD:

    <xs:element name="DOWN_PAYMENT" type="AUS_DOWN_PAYMENT" minOccurs="0" maxOccurs="unbounded" />

the declaration in the derived class:

    @XmlElement(name = "DOWN_PAYMENT", required = true)
    protected List<DownPayment> downPayment;



I am using a "camel case" plugin, if that might have something to do with it...

Thanks,

B. Rintoul