users@jaxb.java.net

Re: Programmatic validation

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Tue, 30 Nov 2004 07:55:19 -0800

Matthew L Daniel wrote:
> I would like to mention that you cannot express constraints such as this
> using the current XML Schema spec. Thus, if I tried to load an XML
> document and it threw a ValidationException because of a _business_rule_
> error, I would be confused.
>
> I just wanted to implore the JAXB team to not take this concept too far.

Thanks for your thought.

On the other hand, in schema languages, there's always some constraints
that cannot be expressed in a schema. That's just the normal state of
play in this field.

In my own experience of reading XML and processing it, I think it's
benefitial for many applications if a system like JAXB provides a way to
integrate your own constraint check logic.

I think it's not hard to do this in a way where you can dinstinguish
schema validation errors from your own constraint check errors, just
like it should be easy to distinguish well-formedness errors from
validity errors.

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net