I have the following issue: I wrote a function in my .xqy file, but when I try to call it, I get the error:
Call to undeclared function: local:getStr
That’s simply what I’m doing:
declare function local:getStr($str as xs:string) as xs:string{
...
};
return
...
<td>{local:getStr($var)}</td>
If your example is complete except for the ellipses, your problem would appear to be that you never bind any namespace to the prefix
local. You will need to add something likein the prolog of your XQuery module. If that’s the problem, then the error message is not the most informative one I’ve ever seen in my life.
(If you do have a namespace declaration in your code, but elided it as irrelevant for the problem, then I suggest finding the shortest example you can manage that will replicate your problem, and adding it to the question.)