views:

432

answers:

1

Hi,

I have been having problem with adding type="date" in my schema, as whenever it is null it throws a marshalling error. I found out that for elements we can add an attribute like nullable="true" and get rid of this issue. But, wasn't able to find similar way for attributes. Is there a way to avoid this issue for attributes?

Thanks!

+1  A: 

There is no "nillable" option for attributes, unfortunately.

You can however adorn an attribute with a use="optional" specifier which should take care of the case where the attribute is not present (shouldn't cause an error).

Marc

marc_s
Hi Marc, I am using use="optional" attribute, but it is not helping with this issue.
Ankush
hhmm.... odd.... not sure if that's a quirk or problem in jaxb - I'm not familiar with that tool, so I can't really help there....
marc_s
Thanks...anyways....
Ankush