camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: Xquery endpoing with Import Module
Date Sat, 30 Jul 2011 01:19:02 GMT
We are always open and welcome the patches, that is how Apache works :)
Please create a JIRA and submit a patch with ASF license granted, I will 
help you to apply it into the Camel trunk.

Willem

On 7/30/11 6:19 AM, jmandawg wrote:
> It looks like you might be able to do something even simpler by calling
> resolveMandatoryResource from within the ModuleURIResolver.  That way it
> will resolve the import in the same way it resolves the endpoint xquery.
>
>
>
> I can take a shot at writing a patch if you guys want.
>
>
>
> From: J- MAN [mailto:jmandawg@hotmail.com]
> Sent: Friday, July 29, 2011 11:29 AM
> To: ml-node+4646571-592493739-235790@n5.nabble.com
> Subject: RE: Xquery endpoing with Import Module
>
>
>
> 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/ModuleUR
> IResolver.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: ml-node+4646571-592493739-235790@n5.nabble.com
> To: jmandawg@hotmail.com
> 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-tp46433
> 85p4643385.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

Mime
View raw message