users@jaxb.java.net

Re: Do not marshal empty elements...

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Fri, 29 Apr 2005 10:12:21 -0700

Jagdeep_Singh_at_capgroup.com wrote:
> Sorry about being too short in the beginning.....
>
> I am building content editor web app using JAXB. So on one of the page
> showing up to the user having fields corresponding to each elements in
> schema. Now if user does not enter value in one of the field. I don't want
> to marshall empty field back to xml. So for example if page has
>
> foo input field and user does not fill that up .... than i don't want
> <foo/> in underline xml file.
>
> The reason is the other search functionality in my app searching these
> content xmls for some schema elements based on criteria.

In 1.0, I think you either set null, or you can also tell XJC to
generate isSet/unset methods by using a customization (I think it's
<jaxb:globalBindings>), then you can use the unset method.


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com