You are right, after doing more research i discovered that saxon allows 
you to define your own import module URI resolver to resolve the import 
statements.  

All you have to do is implement it a ModuleURIResolver and set it with 
staticQueryContext.setModuleURIResolver.


http://www.saxonica.com/documentation9.1/javadoc/net/sf/saxon/query/ModuleURIResolver.html



Can i submit a patch to camel-xquery that will allow urls like this:



                <camel:to 
uri="xquery:com/test/xquery/manual.xq?moduleResolver=classpath"/>



And then imports will be resolved using absolute classpaths (must include 
leading slash):



              import module namespace utils = "myutils" at 
"/com/test/xquery/utils.xq";




This should only affect imports inside xquery files.


Date: Fri, 29 Jul 2011 04:21:37 -0700
From: [email protected]
To: [email protected]
Subject: Re: Xquery endpoing with Import Module



        camel-saxon will create a input stream to load the xquery file.

I think it's more like saxon issue, saxon should support to load the 

file from class path.


On 7/29/11 1:04 AM, jmandawg wrote:

> Hi all,

>

> I'm trying to use an XQuery endpoint which looks like this:

>

> <camel:to uri="xquery:com/test/xquery/manual.xq"/>

>

> Where "com/test/xquery/manual.xq" is located in my "src/main/resources"

> folder.

>

> When i try to put an import inside the manual.xq file like this:

>

> import module namespace utils = "myutils" at "utils.xq";

>

> It cannot resolve the file.  If i give it a absolute uri to the file it can

> resolve it.  But the files need to live in my package.

>

> I'm running this inside servicemix.

>

> Thanks.

>

> --

> View this message in context: 
> http://camel.465427.n5.nabble.com/Xquery-endpoing-with-Import-Module-tp4643385p4643385.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

>


-- 

Willem

----------------------------------

FuseSource

Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)

          http://jnn.javaeye.com (Chinese)

Twitter: willemjiang

Weibo: willemjiang


        
        

        

        
        
                If you reply to this email, your message will be added to the 
discussion below:
                
http://camel.465427.n5.nabble.com/Xquery-endpoing-with-Import-Module-tp4643385p4646571.html
        
        
                
                To unsubscribe from Xquery endpoing with Import Module, click 
here.
                                                  

--
View this message in context: 
http://camel.465427.n5.nabble.com/Xquery-endpoing-with-Import-Module-tp4643385p4647400.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to