users@jaxb.java.net

Re: Does not throw an validation exception

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 12 May 2003 10:42:34 -0700

Generally speaking, I think it would be desirable for the schema to
capture as much constraints as possible. In this way, you can find more
problems in the input document earlier.

But given the ugly pattern facet, I'd just add a documentation in the
schema by using a natural language and say "the format is YYYYMMDD where ...."
and use the parse method to do the actual validation. After all, like
you wrote, that validation comes for free when you use the
SimpleDateFormat class.

So I think what you're doing is a sensible thing.

regards,
--
Kohsuke KAWAGUCHI                  408-276-7063 (x17063)
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com