Changes

Jump to navigation Jump to search
874 bytes added ,  09:44, 27 May 2013
let $entries := archive:entries($zip)[matches(., '\.x?html?$', 'i')]
return file:write-binary('new.zip', archive:delete($zip, $entries))
</pre>
|}
 
==archive:write==
 
{{Mark|Added in Version 7.7}}:
 
{| width='100%'
|-
| width='90' | '''Signatures'''
|{{Func|archive:write|$path as xs:string, $archive as xs:base64Binary|xs:string*}}<br/>{{Func|archive:write|$path as xs:string, $archive as xs:base64Binary, $entries as item()*|empty-sequence()}}
|-
| '''Summary'''
|Writes files of an archive to disk.<br/>The entries to be written can be limited via {{Code|$entries}}. The format of the argument is the same as for [[#archive:create|archive:create]] (attributes will be ignored).
|-
| '''Errors'''
|{{Error|FILE0001|File Module#Errors}} a specified path does not exist.
|{{Error|ARCH9999|#Errors}} archive creation failed for some other reason.
|-
| '''Examples'''
|This example unzips all files of an archive to the current directory:
<pre class="brush:xquery">
archive:write(file:read-binary('archive.zip'))
</pre>
|}
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu