users@jaxb.java.net

Re: Resolve the schema location from the classpath?

From: James Mao <james.mao_at_iona.com>
Date: Sun, 19 Nov 2006 20:03:11 +0800

Hi,

Thanks for you reply,

>
>> I have a problem to resolve the schema location from the classpath, i
>> don't know if the jaxb xjc can resolve the schema location from
>> classpath?
>> for example:
>>
>> I have a xsd in which i have an import statement like following:
>> <xs:import namespace="http://schemas.xmlsoap.org/wsdl/"
>> schemaLocation="/schemas/wsdl/wsdl.xsd"/>
>
> If you write like that, the actual schema location is primarily
> determined by the absolutization of your relative URL
> "/schemas/wsdl/wsdl.xsd". So it depends on what URL your XSD that
> contains that <import> statement has.
I don't know if this can be thought as a absolute location:
schemas.jar!/schemas/wsdl/wsdl.xsd, the schemas.jar is in my classpath?
>
> I think such absolutization rule is well understood, because you face
> that in HTTP URLs all the time.
>
> You can affect this resolution process by using your entity resolver,
> or the catalog resolver bundled in the JAXB RI. See the -catalog
> option and https://jaxb.dev.java.net/nonav/2.0.4/docs/catalog.html
>
entity resolver you mentioned may solve my problem, but i don't know how
to add the entity resolver into the xjc maven plugin, do you know how or
where's the doc?
I think the catalog has the same problem, it'll not look into the
classpath to resolve the schemaLocation, right?

Thanks a lot,
James.