Changes

Jump to navigation Jump to search
127 bytes removed ,  15:28, 9 June 2015
Remove outdated sentence about NaNs in map:get() description
|-
| '''Summary'''
|Returns the value associated with a supplied key in a given map. This function attempts to find an entry within the ''map'' supplied as {{Code|$input}} that has a key equal to the supplied value of {{Code|$key}}. If there is such an entry, the function returns the associated value; otherwise it returns an empty sequence. No error is raised if the map contains keys that are not comparable with the supplied {{Code|$key}}. If the supplied key is {{Code|xs:untypedAtomic}}, it is converted to {{Code|xs:string}}. If the supplied key is the {{Code|xs:float}} or {{Code|xs:double}} value {{Code|NaN}}, the function returns an empty sequence.
A return value of {{Code|()}} from {{Code|map:get}} could indicate that the key is present in the map with an associated value of {{Code|()}}, or it could indicate that the key is not present in the map. The two cases can be distinguished by calling {{Code|map:contains}}.
Invoking the ''map'' as a function item has the same effect as calling {{Code|get}}: that is, when {{Code|$input}} is a map, the expression {{Code|$input($K)}} is equivalent to {{Code|get($input, $K)}}. Similarly, the expression {{Code|get(get(get($input, 'employee'), 'name'), 'first')}} can be written as {{Code|$input('employee')('name')('first')}}.
administrator, editor
43

edits

Navigation menu