users@jaxb.java.net

Re: newbe question: marshalling element default values ?

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 06 Nov 2006 10:32:04 -0800

José Soler wrote:
> But when trying to marshall a xml document from an object generated based on
> the code below, the elements that are not set do not appear in the reulting
> XML document.
> How can I force that the elements not set appear in the resulting XML
> document according to the defualt values and restrictions defined in the
> schema?

This is because element defaulting in XML Schema doesn't work in the way
you thought it would. See
https://jaxb.dev.java.net/guide/Element_default_valus_and_marshalling.html


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com