This [[Module Library|XQuery Module]] contains functions to handle archives (including ePub, Open Office, JAR, and many other formats). New ZIP and GZIP archives can be created, existing archives can be updated, and the archive entries can be listed and extracted. This module may soon replace the existing The [[ZIP Module#archive:extract-binary|archive:extract-binary]] ([http://spex.basex.org/index.php?title=ZIP_Module more information])function includes an example for writing the contents of an archive to disk.
=Conventions=
let $contents := archive:extract-binary($archive)
for $entry at $p in $entries
return ( file:create-dir(replace($entry, "[^/]*$", "")), file:write-binary($entry, $contents[$p]))
</pre>
|}