[MarkLogic Dev General] Problem with xdmp:invoke module

Pradeep Maddireddy pradeep400 at gmail.com
Wed Apr 21 08:52:29 PDT 2010


Hi..!

Can some one tell me whats wrong with this Query

try
{
xdmp:document-load("/abc.xml")
}
catch  ($e)
{
<span>Problem loading </span>
}

When I run it in cq it works fine. When I create test_trycatch.xqy
file with the same
query and invoke it using xdmp: invoke I get the following error

[1.0] XDMP-UNEXPECTED: (err:XPST0003) Unexpected token syntax error,
unexpected Lbrace_, expecting $end

test_trycatch.xqy content
--------------------------------------------------------------------------------------------
xquery version "1.0";
declare namespace xdmp="http://marklogic.com/xdmp";

try
{
xdmp:document-load("/abc.xml")
}
catch  ($e)
{
<span>Problem loading </span>
}
--------------------------------------------------------------------------------------------
Invoking from cq as follows

xquery version "1.0";
declare namespace xdmp="http://marklogic.com/xdmp";
xdmp:invoke("test_trycatch.xqy")
--------------------------------------------------------------------------------------------

Thanks in advance

Pradeep Maddireddy


More information about the General mailing list