[Monetdb-developers] Data type of the text() nodes
Hello,
I'm having a problem with the data type of text() nodes in XRPC
implementation.
---------------------------
module function definition:
---------------------------
module namespace foo = "xrpc-test-function";
declare function foo:q2($strs as xs:string*) as node()*
{
for $s in $strs
return <bar>{$s}</bar>
};
-----------
test query:
-----------
import module namespace test = "xrpc-test-function"
at "/ufs/zhang/max-nr-params/xrpc-mod.xq";
let $hello := <hello>
<lang>en</lang>
<lang>nl</lang>
</hello>
let $lang := $hello/lang/text()
return execute at {"localhost"} {test:q2($lang)}
-------------------------------------------------------------
I got the error "function could not be resolved" when I run the
XRPC query above. The reason is that all items in the sequence $lang
have the type U_A (xs:untypedAtomic), and they are marshalled in the
XRPC req. msg as, for example:
On Fri, Jun 01, 2007 at 05:14:46PM +0200, Ying Zhang wrote:
[...]
But then problem happens, namely, when the server calls the function 'xquery_sig_match' (in pathfinder.mx), it concludes that xs:untypedAtomic is not a sub-type of xs:string, hence, the function signature can not be resolved.
This error does not occur if the function 'q2' is called without XRPC. So, what is the trick of pathfinder to match the signature? Is xs:untypedAtomic just treated the same as xs:string?
Hi Jennie, the keywords to look for in the Formal Semantics are "type promotion" and "function call". And there are the function conversion rules as implemented in core/fs.brg:function_conversion(). Sorry for my very brief answer, but these pointers should bring you quite far. Jens -- Jens Teubner Technische Universitaet Muenchen, Department of Informatics D-85748 Garching, Germany Tel: +49 89 289-17259 Fax: +49 89 289-17263 I invented <Ctrl><Alt><Delete>, but Bill Gates made it famous. -- David Bradley, member of the original IBM PC design team
participants (2)
-
Jens Teubner
-
Ying Zhang