Changes

Jump to navigation Jump to search
446 bytes added ,  13:55, 7 August 2014
{| width='100%'
| width='120' | '''Signatures'''
|{{Func|map:merge|$inputs input as map(*)*|map(*)}}
|-
| '''Summary'''
| Constructs and returns a new map. The ''map'' is formed by combining the contents of the maps supplied in the {{Code|$inputsinput}} argument. The maps are combined as follows:
# There is one entry in the new map for each distinct key value present in the union of the input maps, where keys are considered distinct according to the rules of the {{Code|distinct-values}} function.
# The associated value for each such key is taken from the last map in the input sequence {{Code|$inputsinput}} that contains an entry with this key.
There is no requirement that the supplied input maps should have the same or compatible types. The type of a map (for example {{Code|map(xs:integer, xs:string)}}) is descriptive of the entries it currently contains, but is not a constraint on how the map may be combined with other maps.
* <code>map:merge(($week, map{ 6: "Sonnabend" }))</code> creates <code>map { 0: "Sonntag", 1: "Montag", 2: "Dienstag", 3: "Mittwoch", 4: "Donnerstag", 5: "Freitag", 6: "Sonnabend" }</code>.
|}
 
==map:put==
 
{{Mark|Added with Version 8.0}}:
 
{| width='100%'
| width='120' | '''Signatures'''
|{{Func|map:put|$input as map(*), $key as xs:anyAtomicType, $value as item()*|map(*)}}
|-
| '''Summary'''
| Creates a new ''map'', containing the entries of the {{Code|$input}} argument and a new entry composed by {{Code|$key}} and {{Code|$value}}. The semantics of this function are equivalent to <code>map:merge(($input, map { $key, $value }))<code>
==map:remove==
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu