atom feed1 message in net.sourceforge.lists.saxon-help[saxon] Difficulty with proper use of...
FromSent OnAttachments
Mattio ValentinoApr 28, 2011 8:35 pm 
Subject:[saxon] Difficulty with proper use of IQueryResolver and import module statement
From:Mattio Valentino (matt@gmail.com)
Date:Apr 28, 2011 8:35:16 pm
List:net.sourceforge.lists.saxon-help

Hello,

I'm trying to use Saxon HE 9.3 in C# to call some XQuery modules. I was successful in calling a simple function and now I'm trying to test a simple import module example.

The module is simple:

xquery version "1.0"; module namespace abc = "http://xquery.mydomain.com";

declare function abc:integer-test() as xs:integer { 101 };

The main code is simple as well:

xquery version "1.0"; import module namespace abc = "http://xquery.mydomain.com/" at "module-simple.xq";

abc:integer-test() (:101:)

Both are in the same directory.

If I call the main code without an IQueryResolver, the error I get is "System.ArgumentNullException : Value cannot be null. Parameter name: uriString". If I comment out the import and the function call, and return 101, everything runs fine.

If I build a simple IQueryResolver and pass in the path and file for module-simple.xq, then add the namespace declaration, the error I get is "Saxon.Api.StaticError : Cannot find a matching 0-argument function named {http://xquery.mydomain.com}integer-test()".

I'm certain there's something very simple I'm missing, but I can't figure out what it is. Can anyone point me in the right direction?

------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd