users@jaxb.java.net

Unset method not generated

From: Lichtenwalter, Ryan <ryan.lichtenwalter_at_lmco.com>
Date: Thu, 02 Nov 2006 12:04:33 -0600

I have a problem where, for an optional schema attribute, though xjc
generates an isSet method, a setter, and a getter, it does not create an
unset method and the marhsaller fails if I do not use the set method to
provide a value. xjc failes to produce the unset method even if I add a
custom binding for the attribute using:

                <jxb:bindings schemaLocation="------------"
node=".//xs:attribute[@name='updatedSince']">
                        <jxb:property generateUnsetMethod="true"/>
                </jxb:bindings

Here is the schema definition for this attribute.

            <xs:attribute name="updatedSince" type="xs:dateTime"
use="optional"/>


The strange thing is that it does correctly generate unset methods for
other optional elements and attributes even without the binding
customization. Any ideas what the problem is and how I can solve it.

Thanks,

Ryan