This is because the default namespace of the library module is your library
namespace (http://test.com).
You need to prefix the error function in the library module with fn, then it
works:
xquery version "1.0";
module namespace t = "http://test.com";
declare function t:fun() {
fn:error((), 'bla bla')
};
-Danny
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Florent Georges
Sent: Wednesday, March 04, 2009 4:11 PM
To: MarkLogic General ML
Subject: [MarkLogic Dev General] Undefined function error()
Hi,
I got an error message I don't understand regarding the
error() function not existing. I put the following in the
file <marklogic>/Modules/test-error.xq:
xquery version "1.0";
module namespace t = "http://test.com";
declare function t:fun() {
error((), 'bla bla')
};
and run the following through CQ:
xquery version "1.0";
import module namespace t = "http://test.com"
at "/test-error.xq";
t:fun()
I get the following error:
query evaluated in Documents at file::Docs/ as 1.0 (cq v4.0-3)
[1.0] XDMP-UNDFUN: (err:XPST0017) Undefined function error()
Stack trace:
in /test-error.xq line 5:
xdmp:eval("xquery ve [...]
Thanks in advance. Regards,
--
Florent Georges
http://www.fgeorges.org/
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general