Created
December 5, 2010 19:44
-
-
Save wpaven/729396 to your computer and use it in GitHub Desktop.
This file contains 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
let $transactions := | |
for $i at $index in 1 to $total-transactions | |
let $map := map:map() | |
let $start := (($i -1) *$transaction-size) + 1 | |
let $finish := min((($start - 1 + $transaction-size),$entry-count)) | |
let $put := | |
for $entry in ($entries)[$start to $finish] | |
let $id := fn:concat(fn:string($entry/atom:id),".xml") | |
return map:put($map,$id,$entry) | |
return $map | |
(: the callback function for ingest :) | |
let $function := xdmp:function(xs:QName("feed:process-file")) | |
let $ingestion := | |
for $transaction at $index in $transactions | |
return | |
try { | |
infodev:transaction($transaction,$ticket-id,$function,$policy-deltas,$index,(),()) | |
} catch($e) { | |
infodev:handle-error($ticket-id, concat("transaction ",$index), $e) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment