Hi Geert, Oops sorry about that typo... Many thanks, it works much better now !
Lanz > Message: 5 > Date: Fri, 7 May 2010 18:38:56 +0200 > From: Geert Josten <[email protected]> > Subject: Re: [MarkLogic Dev General] XDMP-UNEXPECTED while using > xdmp:eval > To: General Mark Logic Developer Discussion > <[email protected]> > Message-ID: > <0260356c6dfe754ba6fa48e659a143386077393...@helios.olympus.borgus.nl> > Content-Type: text/plain; charset="Windows-1252" > > Hi Lanz, > > You have a typo in your eval query. There should be an 'as' between the > varname and its type.. > > 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 Lanz >> Sent: vrijdag 7 mei 2010 18:36 >> To: general >> Subject: [MarkLogic Dev General] XDMP-UNEXPECTED while using xdmp:eval >> >> Hi all, >> >> I'm trying to create a document outside a first transaction >> using xdmp:eval but ML throws always the same error: >> [1.0-ml] XDMP-UNEXPECTED: (err:XPST0003) Unexpected token >> syntax error, unexpected QName_, expecting ColonEquals_ or >> External_ or Lbrace_ >> >> Here is the code : >> >> xquery version '1.0-ml'; >> >> declare function >> local:document-insert-isolated( $targetURI as xs:string, >> $sourceURI as node()) as empty-sequence() { >> xdmp:eval(" >> xquery version '1.0-ml'; >> declare variable $MySourceURI node() external ; >> declare variable $MyTargetURI xs:string external ; >> >> xdmp:document-insert('/data/items/repository/2010/2010-05-07.x >> ml',$MySourceURI)" >> , >> (xs:QName("MySourceURI"), $sourceURI) >> , >> <options xmlns='xdmp:eval'> >> <isolation>different-transaction</isolation> >> <prevent-deadlocks>true</prevent-deadlocks> </options> >> ) >> >> >> }; >> local:document-insert-isolated("/data/items/repository/2010/20 >> 10-05-07.xml",fn:doc("/data/items/input/20100507.xml")) >> >> here is the stack trace : >> [1.0-ml] XDMP-UNEXPECTED: (err:XPST0003) Unexpected token >> syntax error, unexpected QName_, expecting ColonEquals_ or >> External_ or Lbrace_ >> >> Stack trace: >> >> line 3: >> 1: xquery version '1.0-ml'; >> 2: >> 3: declare function >> 4: local:document-insert-isolated( $targetURI as xs:string, >> $sourceURI as node()) >> 5: as empty-sequence() >> >> xdmp:eval(" xquery version '1.0-ml'; declare >> variable $My...", (fn:QName("", "MySourceURI"), >> fn:doc("/data/items/input/20100507.xml")), <options >> xmlns="xdmp:eval"><isolation>different-transaction</isolation> >> <prevent-deadlocks>t...</options>) >> >> >> line 7: >> 5: as empty-sequence() >> 6: { >> 7: xdmp:eval(" >> 8: xquery version '1.0-ml'; >> 9: declare variable $MySourceURI node() external ; >> >> local:document-insert-isolated("/data/items/repository/2010/20 >> 10-05-07.xml", >> fn:doc("/data/items/input/20100507.xml")) >> >> $targetURI := "/data/items/repository/2010/2010-05-07.xml" >> $sourceURI := fn:doc("/data/items/input/20100507.xml") >> >> line 20: >> 18: >> 19: }; >> 20: >> local:document-insert-isolated("/data/items/repository/2010/20 >> 10-05-07.xml",fn:doc("/data/items/input/20100507.xml")) >> >> xdmp:eval("xquery version '1.0-ml'; declare >> function
...", (), <options >> xmlns="xdmp:eval"><database>1070611528638525672</database><mod >> ules>107061152863852...</options>) >> >> >> in /cq/eval.xqy line 111: >> >> Thanks in advance for any guidance >> Lanz >> _______________________________________________ >> General mailing list >> [email protected] >> http://developer.marklogic.com/mailman/listinfo/general >> > > > ------------------------------ > > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general > > > End of General Digest, Vol 71, Issue 15 > *************************************** > _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
