Version 1.0.
The underlying type is defined like this:
<xs:simpleType name="ourType">
<xs:restriction base="xs:nonNegativeInteger">
<xs:maxInclusive value="99"/>
</xs:restriction>
</xs:simpleType>
Yes, we are knowingly sending an empty element to the marshaller. Are you saying that an empty element for this definition is invalid? We were very surprised that this passed validation as well. So, perhaps it is a bug.
I will look at the customization example.
Thanks,
Scott
Kohsuke Kawaguchi <kohsuke.kawaguchi_at_sun.com> wrote:
Scott Kaszyk wrote:
> I have a schema that defines a mandatory element (minOcc=1, maxOcc=1). JAXB
> represents this element as a BigInteger type.
>
> When an empty element for this mandatory element is passed to the unmarshaller,
> it passes validation. However, I am not able to marshal back into an empty element.
>
> Does anyone know how to accomplish getting past the validator and marshalling an
> empty element?
Is that 1.0 or 2.0?
empty element for xs:decimal isn't a valid XML. Are you knowingly doing
this?
The validator is supposed to catch it as an error, so that sounds like a
bug.
And as long as it's bound to BigInteger, there's no way to print out an
empty element (after all, it's not a valid XML!).
If you really insist on generating an invalid XML, you can use
customization to bind it to String. There's a sample in the
JAXB RI bundle that shows you how to use customization.
--
Kohsuke Kawaguchi
Sun Microsystems kohsuke.kawaguchi_at_sun.com
---------------------------------
Discover Yahoo!
Have fun online with music videos, cool games, IM & more. Check it out!