Changes

Jump to navigation Jump to search
819 bytes added ,  15:02, 12 December 2017
=Updates=
 
==update:for-each==
 
{|
|-
| width='120' | '''Signatures'''
|{{Func|update:apply|$function as function(*), $arguments as array(*))|empty-sequence()}}
|-
| '''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>.
|-
| '''Examples'''
|
* Creates a new database with an initial document and adds a document to an existing database.
<pre class="brush:xquery">
declare %updating function local:update(
$database as xs:string,
$path as xs:string,
$function as %updating function(item(), xs:string) as empty-sequence()
) as empty-sequence() {
update:apply($function, [ $database, $path ])
};
local:update('new-db', 'doc.xml', db:create#2),
local:update('existing-db', 'doc.xml', db:add#2)
</pre>
|}
==update:for-each==
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu