users@jaxb.java.net

Error marshalling nillable elements

From: vinodh rc <vinodh.rc_at_semanticbits.com>
Date: Tue, 5 Oct 2010 10:52:54 -0400

Hi,

I have a JAXBElement wrapping a nillable element say 'person' as child for
the complex type, 'employee'.

In my object graph, the JAXBElement<Person> has setNil(true). However, the
instance of Person used to create the JAXBElement<Person> is not null. It
has some of its attributes set into it.

When i marshal the above object, employee. It is not adding the xsi:nil=true
to the <person> element under <employee> as it is supposed.

Could you please let me know, how it can be achieved? If this is a bug in
JAXB, will i able to get a patch? If not, could you direct me to which class
in jaxb-ri sources has to be fixed for this?

Thanks,
Vinodh