Changes

Jump to navigation Jump to search
14 bytes added ,  16:16, 9 March 2023
no edit summary
| width='120' | '''Signature'''
|<pre>update:apply(
$function as function(*),
$arguments as array(*)
) as empty-sequence()</pre>
| width='120' | '''Signature'''
|<pre>update:for-each(
$seq input as item()* $function action as function(item())
) as empty-sequence()</pre>
|- valign="top"
| '''Summary'''
|The updating variant of [[Higher-Order Functions#fn:for-each|fn:for-each]] applies the specified updating <code>$functionaction</code> to every item of <code>$seqinput</code>.
|- valign="top"
| '''Examples'''
| width='120' | '''Signature'''
|<pre>update:for-each-pair(
$seq1 input1 as item()*, $function input2 as item()*, $action as function(item())
) as empty-sequence()</pre>
|- valign="top"
| '''Summary'''
|The updating variant of [[Higher-Order Functions#fn:for-each-pair|fn:for-each-pair]] applies the specified updating <code>$functionaction</code> to the successive pairs of items of <code>$seq1input1</code> and <code>$seq2input2</code>. Evaluation is stopped if one sequence yields no more items.
|- valign="top"
| '''Examples'''
| width='120' | '''Signature'''
|<pre>update:map-for-each(
$map as map(*), $function action as function(xs:anyAtomicType , item()*) as item()*
) as item()*</pre>
|- valign="top"
| '''Summary'''
|The updating variant of {{Function|Map|map:for-each}} applies the specified {{Code|$functionaction}} to every key/value pair of the supplied {{Code|$map}} and returns the results as a sequence.
|- valign="top"
| '''Examples'''
| width='120' | '''Signature'''
|<pre>update:output(
$items input as item()*
) as empty-sequence()</pre>
|- valign="top"
| '''Summary'''
|This function can be used if {{Option|MIXUPDATES}} is not enabled, and if values need to be returned within an updating expression: The supplied {{Code|$itemsinput}} 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'''
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu