Changes

Jump to navigation Jump to search
91 bytes added ,  14:18, 20 July 2022
no edit summary
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|lazy:cache|$items as item()*|item()*}}<br/>{{Func|lazy:cache|$items as item()*, $lazy as xs:boolean|item()*}}
|-valign="top"
| '''Summary'''
|Caches the data of lazy {{Code|$items}} in a sequence:<br />
* If {{Code|$lazy}} is set to {{Code|true()}}, caching will be deferred until the data is eventually requested. Streaming will be disabled: Data will always be cached before a stream is returned.
Caching is advisable if an item will be processed more than once, or if the data may not be available anymore at a later stage.
|-valign="top"
| '''Example'''
|In the following example, a file will be deleted before its content is returned. To avoid a “file not found” error when serializing the result, the content must be cached:
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|lazy:is-lazy|$item as item()|xs:boolean}}
|-valign="top"
| '''Summary'''
|Checks whether the specified {{Code|$item}} is lazy.
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|lazy:is-cached|$item as item()|xs:boolean}}
|-valign="top"
| '''Summary'''
|Checks whether the contents of the specified {{Code|$item}} are cached. The function will always return {{Code|true}} for non-lazy items.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu