Functions that operate on maps
map:contains($map as map(*), $key as xs:anyAtomicType) as xs:boolean
Tests whether a supplied map contains an entry for a given key.
$map | The map |
$key | The key to look up |
map:entry($key as xs:anyAtomicType, $value as item()*) as map(*)
Creates a map that contains a single entry (a key-value pair).
$key | The key |
$value* | The associated value |
map:for-each($input as map(*), $action as function(*)) as item()*
takes any map as its $input argument and applies the supplied function to each entry in the map, in implementation-dependent order; the result is the sequence obtained by concatenating the results of these function calls. The function supplied as $action takes two arguments. It is called supplying the key of the map entry as the first argument, and the associated value as the second argument.
$input | The map |
$action | The function to be called for each entry |
map:get($map as map(*), $key as xs:anyAtomicType) as item()*
Returns the value associated with a supplied key in a given map.
$map | The map |
$key | The key to look up |
map:keys($map as map(*)) as xs:anyAtomicType*
Returns a sequence containing all the key values present in a map.
$map | The map |
map:merge($maps as map(*)*) as map(*)
Returns a map that combines the entries from a number of existing maps.
$maps* | Existing maps to merge to create a new map. |
map:put($map as map(*), $key as xs:anyAtomicType, $value as item()*) as map(*)
Returns a map containing all the contents of the supplied map, but with an additional entry, which replaces any existing entry for the same key.
$map | The map |
$key | The key for the entry to insert |
$value* | The value for the entry to insert |
map:remove($map as map(*), $key as xs:anyAtomicType*) as map(*)
Constructs a new map by removing an entry from an existing map.
$map | The map |
$key* | The key to remove |
map:size($input as map(*)) as xs:integer
Returns the number of entries in the supplied map.
$input | Any map to determine the size of. |