Created
November 29, 2012 19:40
-
-
Save ableasdale/4171340 to your computer and use it in GitHub Desktop.
Inserting content using xdmp:eval for isolated (separate) transctions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
declare namespace prop="http://marklogic.com/xdmp/property"; | |
declare variable $doc-count as xs:int := 10; | |
for $item in (1 to $doc-count) | |
let $eval := "xquery version '1.0-ml'; | |
declare variable $count as xs:string external; | |
xdmp:document-insert(fn:concat('/test/', $count, '.xml'), element root{ $count })" | |
return | |
( | |
xdmp:eval($eval, (xs:QName("count"), fn:string($item))), | |
xdmp:sleep(1000) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment