users@jaxb.java.net

External bindings for schema that import another schema

From: Mark Brouwer <mark.brouwer_at_virgil.nl>
Date: Fri, 06 Jun 2003 14:52:01 +0200

As the new XJC tool allows you to use a resolver I thought maybe I can
get rid of the juggling with schemaLocation URIs.

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

I have the feeling this error is generated because there is one binding
file that is associated with the imported schema A and it look likes
that xjc thinks that there is no schema for that binding file. However
if I remove the mapping from the resolver file and substitute modify
schema B to import the schema with a location that is exactly the same
as the local URI in the resolver file it works again.

Am I missing something, I know URIs always drive me crazy but this seems
very strange to me.

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.

"Identify the ?target element? using <jaxb:bindings> attributes.
(i) If the <jaxb:bindings> has a @schemaLocation, the value
of the attribute should be taken as an URI and be absolutized with the
base URI of the <jaxb:bindings> element. Then the target
element will be the root node of the schema document identified by the
absolutized URI. If there?s no such schema document in the current
input, it is an error. Note: the root node of the schema document is not
the document element."
--
Mark Brouwer