users@jaxb.java.net

Re: Episodic compilation against jar file

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Fri, 30 Mar 2007 12:24:55 -0700

Raymond Wold wrote:
> I would like it if xjc looked in the jar file for the schemas the episode file
> inside the jar file refers to, is that possible?

Yes, something like that would be nice, but as always the ugliness of
the schema spec bites us back. That is, sometimes the schema can't be
read by itself, and instead the way it's imported defines how it's
interpreted.

We'd also think about how external references are resolved, like DTD,
XInclude, that sort of things.

So this needs more thinking. Can you file this as an issue, pointing to
this thread?


> I spendt some hours now trying to get episodic compilation to work first with
> my own files, then the examples on
> http://weblogs.java.net/blog/kohsuke/archive/2006/09/separate_compil.html
> before realizing the schemaLocation attribute was the issue. In the example
> from KK's blog, http://alice.org/a.xsd obviously has no schema, and you get
> "[ERROR] src-resolve: Cannot resolve the name 'a:myType' to a(n) 'type
> definition' component." which in itself is less than optimal, a "could not
> find imported schema source" or similar would be better.

Agreed about the error message, but that comes from the JAXP RI. I've
been filing several bugs against them about the quality of the error
message, and this one is https://jaxp.dev.java.net/issues/show_bug.cgi?id=25

> I've tried specifying the schemaLocation using a jar: scheme, but then xjc
> balks on the original files, since the files isn't packaged yet. Besides, the
> location and filename of the jar might change, and the schemaLocation would be
> useless. I don't think it's a good idea to rely on the schemaLocation
> attribute at all to find imported schemas.

I didn't quite follow this part.

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com