Created
June 9, 2014 11:36
-
-
Save ableasdale/313c0bb113a20344af2d to your computer and use it in GitHub Desktop.
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 variable $URIS as xs:string+ := (cts:uris()); | |
declare function local:create-parts-manifest($items) { | |
<parts xmlns="xdmp:zip"> | |
{ | |
for $item in $items | |
return element part {$item} | |
} | |
</parts> | |
}; | |
declare function local:create-sequence-of-docs($items) { | |
( | |
for $item in $items | |
return doc($item) | |
) | |
}; | |
(: Module main :) | |
let $zip := xdmp:zip-create( | |
local:create-parts-manifest($URIS), | |
local:create-sequence-of-docs($URIS) | |
) | |
return | |
xdmp:save("e:/myzip.zip", $zip, | |
<options xmlns="xdmp:save"> | |
<encoding>utf8</encoding> | |
</options>) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment