Changes

Jump to navigation Jump to search
475 bytes added ,  15:20, 12 March 2013
no edit summary
This [[Module Library|XQuery Module]] contains functions for handling ''streamable'' items.
In contrast to conventional XQuery items, streamable items may take up much less space, because they only contain a reference to the actual data. The data itself will only be retrieved if it is requiredby another expression, e.g. or if it needs to be an item is serialized or processed by another expression. Serialization of streamable items takes constant space.
Currently, the The following BaseX functions return streamable items:
* <code>[[Database Module#db:retrieve|db:retrieve]]</code>
* <code>[[File Module#file:read-text|file:read-text]]</code>
Some functions are capable of consuming items in a ''streamable'' fashion: data will never be cached, but instead passed on to another target (file, the calling expression, etc.). The following streaming functions are capable of processing streamed inputcurrently available:
* <code>[[Conversion Module#convert:binary-to-bytes|convert:binary-to-bytes]]</code>
* <code>[[Fetch Module#file:write-text|file:write-text]]</code>
* <code>[[File Module#file:write-binary|file:write-binary]]</code>
 
The exemplary XQuery expression below demonstrates how large files can be downloaded and written to a file with constant memory consumption:
 
<pre class="brush:xquery">
file:write-binary('output.data', fetch:binary('http://files.basex.org/xml/xmark111mb.zip'))
</pre>
=Conventions=
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu