Changes

Jump to navigation Jump to search
48 bytes removed ,  18:33, 1 December 2023
m
Text replacement - "</syntaxhighlight>" to "</pre>"
The XQuery expression below serves as an example on how large files can be downloaded and written to a file with constant memory consumption:
<syntaxhighlight pre lang="'xquery"'>
file:write-binary('output.data', fetch:binary('http://files.basex.org/xml/xmark111mb.zip'))
</syntaxhighlightpre>
If lazy items are serialized, they will be streamed as well.
| '''Example'''
|In the following example, a file is deleted before its content is returned. To avoid a “file not found” error when serializing the result, the content must be cached:
<syntaxhighlight pre lang="'xquery"'>
let $file := 'data.txt'
let $text := lazy:cache(file:read-text($file))
return (file:delete($file), $text)
</syntaxhighlightpre>
|}
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu