Hi Pradeep, If you would have included the version declaration line in CQ (which is perfectly allowed), you would have had the same error there as well..
Kind regards, Geert > drs. G.P.H. (Geert) Josten Consultant Daidalos BV Hoekeindsehof 1-4 2665 JZ Bleiswijk T +31 (0)10 850 1200 F +31 (0)10 850 1199 mailto:[email protected] http://www.daidalos.nl/ KvK 27164984 P Please consider the environment before printing this mail. De informatie - verzonden in of met dit e-mailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. > From: [email protected] > [mailto:[email protected]] On Behalf Of > Glidden, Douglass A > Sent: woensdag 21 april 2010 18:09 > To: [email protected] > Subject: RE: [MarkLogic Dev General] Problem with xdmp:invoke module > > The problem is this line: > > xquery version "1.0"; > > Instead use: > > xquery version "1.0-ml"; > > Try/catch blocks are part of the MarkLogic extensions to > XQuery and are not available with standard XQuery 1.0. > > Doug Glidden > Software Engineer > The Boeing Company > [email protected] > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of > Pradeep Maddireddy > Sent: Wednesday, April 21, 2010 11:52 > 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 > _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
