Changes

Jump to navigation Jump to search
156 bytes removed ,  18:32, 1 December 2023
m
Text replacement - "</syntaxhighlight>" to "</pre>"
doc/index.html
</archive:entry>
</syntaxhighlightpre>
|- valign="top"
| '''Errors'''
<pre lang='xquery'>
sum(archive:entries(file:read-binary('zip.zip'))/@size)
</syntaxhighlightpre>
|}
"algorithm": "deflate"
}
</syntaxhighlightpre>
|}
for $entry in archive:entries($archive)[ends-with(., '.txt')]
return archive:extract-text($archive, $entry)
</syntaxhighlightpre>
|}
file:create-dir(replace($entry, "[^/]+$", "")),
file:write-binary($entry, $content)
})</syntaxhighlightpre>
|}
compression-level='8'
encoding='US-ASCII'>hello.txt</archive:entry>
</syntaxhighlightpre>
The actual {{Code|$contents}} must be {{Code|xs:string}} or {{Code|xs:base64Binary}} items.<br/>
The {{Code|$options}} parameter contains archiving options:
<pre lang='xquery'>
archive:create(<archive:entry>file.txt</archive:entry>, 'Hello World')
</syntaxhighlightpre>
The following function creates an archive {{Code|mp3.zip}}, which contains all MP3 files of a local directory:
<pre lang='xquery'>
return file:read-binary($path || $file)
)
return file:write-binary('mp3.zip', $zip)</syntaxhighlightpre>
|}
let $updated := archive:update($archive, $doc, $entry)
return file:write-binary($output, $updated)
</syntaxhighlightpre>
|}
let $entries := archive:entries($zip)[matches(., '\.x?html?$', 'i')]
return file:write-binary('new.zip', archive:delete($zip, $entries))
</syntaxhighlightpre>
|}
let $zip := archive:create-from('/home/user/')
return file:write-binary('archive.zip', $zip)
</syntaxhighlightpre>
|}
<pre lang='xquery'>
archive:extract-to('.', file:read-binary('archive.zip'))
</syntaxhighlightpre>
|}
('Archive with MP3 files', $files ! file:read-binary(.))
)
</syntaxhighlightpre>
|}
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu