users@jaxb.java.net

Re: Optional List based attributes and marshalling

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Wed, 22 Mar 2006 17:09:09 -0800

Ian Carr wrote:
> If I create and marshal an instance of the class it produces the
> expected output:
>
> <X/>
>
> However if the accessor is invoked before marshalling it produces the
> following output, with an empty 'two' attribute:
>
> <X two=""/>

Ahhh, you are right. This is indeed problematic.

I think you can use a customization

    <jaxb:property generateIsSetMethod="true" />

to generate the "unsetTwo" method, to work around this issue.


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com