Try xquery version "1.0-ml";
try/catch isnt a part of standard xquery 1.0. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Pradeep Maddireddy Sent: Wednesday, April 21, 2010 11:52 AM To: General Subject: [MarkLogic Dev General] Problem with xdmp:invoke module 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 _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
