Changes

Jump to navigation Jump to search
208 bytes added ,  14:20, 20 July 2022
no edit summary
{|
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|update:apply|$function as function(*), $arguments as array(*)|empty-sequence()}}
|-valign="top"
| '''Summary'''
|The updating variant of [[XQuery 3.1#fn:apply|fn:apply]] applies the specified updating <code>$function</code> to the specified <code>$arguments</code>.
|-valign="top"
| '''Examples'''
|
{|
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|update:for-each|$seq as item()*, $function as function(item()) as item()*|empty-sequence()}}
|-valign="top"
| '''Summary'''
|The updating variant of [[Higher-Order Functions#fn:for-each|fn:for-each]] applies the specified updating <code>$function</code> to every item of <code>$seq</code>.
|-valign="top"
| '''Examples'''
|
{|
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|update:for-each-pair|$seq1 as item()*, $function as function(item()) as item()*|empty-sequence()}}
|-valign="top"
| '''Summary'''
|The updating variant of [[Higher-Order Functions#fn:for-each-pair|fn:for-each-pair]] applies the specified updating <code>$function</code> to the successive pairs of items of <code>$seq1</code> and <code>$seq2</code>. Evaluation is stopped if one sequence yields no more items.
|-valign="top"
| '''Examples'''
|
| width='120' | '''Signatures'''
|{{Func|update:map-for-each|$map as map(*), $function as function(xs:anyAtomicType, item()*) as item()*|item()*}}
|-valign="top"
| '''Summary'''
|The updating variant of {{Function|Map|map:for-each}} applies the specified {{Code|$function}} to every key/value pair of the supplied {{Code|$map}} and returns the results as a sequence.
|-valign="top"
| '''Examples'''
|
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|update:output|$items as item()*|empty-sequence()}}
|-valign="top"
| '''Summary'''
|This function can be used if {{Option|MIXUPDATES}} is not enabled, and if values need to returned within an updating expression: The supplied {{Code|$items}} will be cached and returned at the very end, i.e., after all updates on the ''pending update list'' have been processed. If one of the supplied items is affected by an update, a copy will be created and cached instead.
|-valign="top"
| '''Examples'''
|
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|update:cache||item()*}}<br/>{{Func|update:cache|$reset as xs:boolean|item()*}}
|-valign="top"
| '''Summary'''
|Returns the items that have been cached by {{Function||update:output}}. The output cache can optionally be {{Code|$reset}}. The function can be used to check which items will eventually be returned as result of an updating function.<br/>This function is ''non-deterministic'': It will return different results before and after items have been cached. It is e. g. useful when writing [[Unit Module|unit tests]].
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu