users@jaxb.java.net

Re: attribute restrictions not working

From: Malachi de AElfweald <malachi_at_EOTI.ORG>
Date: Fri, 28 Mar 2003 11:54:30 -0700

On Fri, 28 Mar 2003 10:53:06 -0800, Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM> wrote:
>If you want a type-safe enum, change the base type to xsd:NCName. Or you
>can apply a <globalBidings> customization and tell the compiler to
>recognize xsd:string as one of the type-safe-enum capable base type. I
>forgot the exact customization but I'm pretty sure the spec has an
>example.
>
>Or you can call the validation and check if the value is OK. It's just
>that the generated method signature doesn't enforce any additional
>constraint. You can catch all those by using the on-demand validation.
>
>The same thing applies to an integer limited from 1 to 100, etc.

Changing the type from xsd:string to xsd:NCName did the trick. That's great!

With all of the testing I am doing on this, perhaps I will end up with enough test cases to write a GUI JAXB Config tool :)

Malachi