users@jaxb.java.net

Re: Required while MinOccurs = 1

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Wed, 12 Jul 2006 15:21:33 -0700

Bradley Rintoul wrote:
> 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 believe this is reported in issue 189 and I just committed a fix.


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com