users@jaxb.java.net

Re: How to specify what schema to use and where it is located

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Tue, 20 May 2003 08:30:25 -0700

Jorge Medina <jmedina_at_on.com> wrote:
> a) I would like to validate the docuements against the schema, but if the
> document itself does not contain what schema is using , Can I tell JAXB
> what schema to use for validation ?

Sure you can. You are effectively fixing a schema when you call
JAXBContext.newInstance.

In fact the JAXB RI ignores xsi:schemaLocation completely, and always
apply the schema you submitted to XJC.


> b) Can I tell JAXB where to find the schema ?

Now I'm confused. If you are looking for just a validator, not a
data-binding tool, look at JARV (http://iso-relax.sourceforge.net/JARV/).

It allows you validate XML documents with any schema and still ignores
@xsi:schemaLocation. You can then combine it with JAXB if you want.

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