users@jaxb.java.net

Re: External bindings for schema that import another schema

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Fri, 06 Jun 2003 09:50:38 -0700

Mark Brouwer <mark.brouwer_at_virgil.nl> wrote:
> As the new XJC tool allows you to use a resolver I thought maybe I can
> get rid of the juggling with schemaLocation URIs.

Yes, that's the intention of the resolver support.


> However not that successful in all area's for I have a schema B that
> imports A. Normally the schema location of the imported schema A is a
> public visible URL, however I had this one to change for my xjc build
> process. That means that each time I upload my schema I have to modify
> the import declaration.
>
>
> I changed this by using the resolver (which works for schema's that
> don't import) and having a resolve file that maps the public URI of the
> imported schema to a local URI, however the xjc tasks start complaining
> with:
>
> - [xjc] [ERROR]
> "file:/home/marbro/workspace/cheiron/seven/build/schema/jsc.xsd" is not
> a part of this compilation

The binding file should point to the publicly visible URI, not your
local copy. The fact that your publicly visible URI is being redirected
to your local resource is completely invisible to the rest of the
compilation.

Think of the resolver as a socket-level redirection, if you will.



> Also can someone clarify what is meant in the JAXB spec at page 202 with
> the base URI of the <jaxb:bindings> element, I interpretate this as the
> base URI of the file the file <jaxb:bindings> element is defined in, for
> that made things work, but now when I think of it I'm not that sure
> anymore.

I guess we should have refereed to http://www.w3.org/TR/xmlbase/
In a nutshell, the base URI of the <jaxb:binding> element is usually the
file where that element is written.


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