Changes

Jump to navigation Jump to search
725 bytes added ,  21:53, 28 May 2012
|-
| '''Summary'''
|Extracts archive entries and returns them as texts.<br/>The returned entries can be limited via to {{Code|$entry-names}}.<br/>The optional parameter {{Code|$encoding}} defines the encoding of the file.
|-
| '''Examples'''
for $entry in zip2:entries($archive)[ends-with(., '.txt')]
return zip2:extract-texts($archive, $entry)
</pre>
|}
 
==zip2:extract-binaries==
 
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|zip2:extract-binaries|$zip as xs:base64Binary|xs:string*}}<br/>{{Func|zip2:extract-binaries|$zip as xs:base64Binary, $entry-names as xs:string*|xs:string*}}
|-
| '''Summary'''
|Extracts archive entries and returns them as binaries.<br/>The returned entries can be limited to {{Code|$entry-names}}.
|-
| '''Examples'''
|This example unzips all files of an archive to the current directory:
<pre class="brush:xquery">
let $archive := file:read-binary('archive.zip')
let $entries := zip:entries($archive)
let $contents := zip:extract-binaries($archive)
for $entry at $p in $entries
return file:write-binary($entry, $contents[$p])
</pre>
|}
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu