You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by quzhe <zh...@hotmail.com> on 2008/05/26 12:44:53 UTC

import xsd from classpath?


Hi,All:
 
Does xmlbean support import xsd by classpath?
 
ie:
 
query-1.0.xsd is included in another jar file, and I use maven-plugin generate java sources
 
<s:schema elementFormDefault="qualified" targetNamespace="http://www.test.com" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:q="http://www.test.com/query" xmlns:tns="http://www.test.com">     <s:import namespace="http://www.test.com/query" schemaLocation="file:///d:/com/test/query/query-1.0.xsd"/>
 
it is correct, but when I change it to
 
<s:import namespace="http://www.test.com/query" schemaLocation="classpath://com/test/query/query-1.0.xsd"/> 
 
maven show those information:
 
[INFO] XmlBeans compile failed: xml ErrorLoading schema file D:\tests\interface\src\main\xsd\Order.xsdxml ErrorD:\tests\interface\src\main\xsd\Order.xsd:3:3: error: Could not load resource "classpath://com/test/query/query-1.0.xsd" (network downloads disabled).
 
 
Regards
_________________________________________________________________
新年换新颜,快来妆扮自己的MSN给心仪的TA一个惊喜!
http://im.live.cn/emoticons/?ID=18

Re: import xsd from classpath?

Posted by Jacob Danner <ja...@gmail.com>.
Hi,
I don't think this is an xmlbeans issue, but rather an issue with how
you are trying to access the imported xsd. From what I can remeber the
value of the schemaLocation attribute has to match xs:anyUri. File,
http, etc are valid for xs:anyUri but classpath is not. 
Is there a
tool you know of that supports this format?
-jacobd

On 5/26/08, quzhe <zh...@hotmail.com> wrote:
>
>
> Hi,All:
>
> Does xmlbean support import xsd by classpath?
>
> ie:
>
> query-1.0.xsd is included in another jar file, and I use maven-plugin
> generate java sources
>
> <s:schema elementFormDefault="qualified"
> targetNamespace="http://www.test.com"
> xmlns:s="http://www.w3.org/2001/XMLSchema"
> xmlns:q="http://www.test.com/query" xmlns:tns="http://www.test.com">
> <s:import namespace="http://www.test.com/query"
> schemaLocation="file:///d:/com/test/query/query-1.0.xsd"/>
>
> it is correct, but when I change it to
>
> <s:import namespace="http://www.test.com/query"
> schemaLocation="classpath://com/test/query/query-1.0.xsd"/>
>
> maven show those information:
>
> [INFO] XmlBeans compile failed: xml ErrorLoading schema file
> D:\tests\interface\src\main\xsd\Order.xsdxml
> ErrorD:\tests\interface\src\main\xsd\Order.xsd:3:3: error: Could not load
> resource "classpath://com/test/query/query-1.0.xsd" (network downloads
> disabled).
>
>
> Regards
> _________________________________________________________________
> 新年换新颜,快来妆扮自己的MSN给心仪的TA一个惊喜!
> http://im.live.cn/emoticons/?ID=18


-- 
I'm competing in a Half-Ironman distance triathlon to raise money for
the fight against cancer!
Please help support my efforts by going to:
http://www.active.com/donate/tntwaak/jacobd