users@jaxb.java.net

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

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Fri, 29 Sep 2006 16:33:55 -0700

Dmitri Colebatch wrote:
> I've read your blog, but I'm still going to be stuck as the best I can
> do is get WSDL. I'm assuming that there's absolutely nothing I can do
> without a static schema to reference?

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?


> Is it theoretically possible that JAXB might be able to be modified so
> that I didn't need the schema? Ie, if I gave xjc a reference to the
> ObjectFactories and classes/packages that it should use, then it could
> get to an element and go, hey, I already have a compiled class for
> this QName, I'll use that. I realise that currently this is coming
> from the parser, but if the parser was given an entity resolver that
> used the above logic, this would in theory work wouldn't it?
>
> I'm not asking for this to be done, just trying to make sure I
> understand where the limitation is.

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.

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

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com