users@jaxb.java.net

Re: xjc - compiling schema that references other namespace without schema

From: Dmitri Colebatch <dim_at_colebatch.com>
Date: Mon, 2 Oct 2006 16:14:32 +1000

Thanks Kohsuke,

A couple of comments inline:

On 9/30/06, Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_sun.com> wrote:
> I'm not sure if I understand, but are you saying that the schema
> components that you are trying to refer is inside WSDL? Can you just
> take out the type definition portion into its own schema, with a simple
> transformation?

I can, but the problem is then that my schema isn't correct. In order
to do this (correct me if I am wrong) I would need to have my schema
contain an import of the transformed WSDL (imported schema) along with
a schema location. When I publish this schema, the schema location
will not be correct.

What I'd like to do is be able to define my own EntityResolver which
could do the transformation. That way I could do something like:

        <xsd:import namespace="urn:dim:test-missing" />

which would then give me a chance to locate it in my EntityResolver
without breaking the schema. As far as I'm aware, this isn't possible
- is it something that could be added?

> XSOM won't work if references are unresolved. Also, for XJC to find out
> that a particular schema component is already bound, it needs to have an
> object that represents such bound component.
>
> So I think it's a pretty fundamental requirement.

I've had a look at xsom now, and realise that the level of detail you
want from XSElementDecl etc isn't possible without the full schema. I
had only been thinking in terms of my requirements which are currently
limited to a simple javabean. All I'm after is something like "this
QName maps to this java class".

> Maybe you can run schemagen first to get a dummy schema generated?

Yeah, although this would suffer the same limitation as pulling the
schema out of the WSDL.

Thanks again for your help, if you could comment on the possibility of
using a custom EntityResolver I'd be grateful.

cheers
dim