users@jaxb.java.net

Re: Marshal Empty Elements

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 13 Jun 2005 19:29:20 -0400

Scott Kaszyk wrote:
> 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.

Yes. It is invalid. I mean, "" is not a valid non-negative integer.

When you say validation, you mean Unmarshaller.setValidating(true), right?

I'm pretty sure this causes a validation error in 2.0.

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com