Changes

Jump to navigation Jump to search
697 bytes added ,  14:50, 12 December 2017
no edit summary
| '''Examples'''
|
* Creates two databasesRenames nodes in an XML snippets:
<pre class="brush:xquery">
copy $xml := <xml><a/><b/></xml>
return $xml
</pre>
|}
 
==update:map-for-each==
 
{| width='100%'
| width='120' | '''Signatures'''
|{{Func|update:map-for-each|$map as map(*), $function as function(xs:anyAtomicType, item()*) as item()*|item()*}}
|-
| '''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.
|-
| '''Examples'''
|Inserts attributes into a document:
<pre class="brush:xquery">
copy $doc := <xml/>
modify update:map-for-each(
map {
'id': 'id0',
'value': 456
},
function($key, $value) {
insert node attribute { $key } { $value } into $doc
}
)
return $doc</pre>
|}
Bureaucrats, editor, reviewer, Administrators
12,003

edits

Navigation menu