};
</pre>
==map:collation==
{| width='100%'
| width='120' | '''Signatures'''
|{{Func|map:collation|$map as map(*)|xs:string}}
|-
| '''Summary'''0
| Returns the collation URI of the ''map'' supplied as {{Code|$map}}.
|}
==map:contains==
|-
| '''Summary'''
| Returns true if the ''map'' supplied as {{Code|$map}} contains an entry with a key equal to the supplied value of {{Code|$key}}; otherwise it returns false. The equality comparison uses the map's collation; no No error occurs 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 false.
|-
|-
| '''Summary'''
| Creates a new ''map'' containing a single entry. The collation of the new map is the default collation from the static context. The key of the entry in the new map is {{Code|$key}}, and its associated value is {{Code|$value}}. 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 supplied {{Code|$map}} is returned unchanged.
The function {{Code|map:entry}} is intended primarily for use in conjunction with the function <code>[[#map:new|map:new]]</code>. For example, a map containing seven entries may be constructed like this:
|-
| '''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|$map}} that has a key equal to the supplied value of {{Code|$key}}. If there is such an entry, it returns the associated value; otherwise it returns an empty sequence. The equality comparison uses the map's collation; no No error occurs 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|$map}} is a map, the expression {{Code|$map($K)}} is equivalent to {{Code|get($map, $K)}}. Similarly, the expression {{Code|get(get(get($map, 'employee'), 'name'), 'first')}} can be written as {{Code|$map('employee')('name')('first')}}.
{| width='100%'
| width='120' | '''Signatures'''
|{{Func|map:new||map(*)}}<br/>{{Func|map:new|$maps as map(*)*|map(*)}}<br/>{{Func|map:new|$maps as map(*)*, $coll as xs:string|map(*)}}
|-
| '''Summary'''
| Constructs and returns a new map. The zero-argument form of the function returns an empty ''map'' whose collation is the default collation in the static context. It is equivalent to calling the one-argument form of the function with an empty sequence as the value of the first argument.The one-argument form of the function returns a ''map'' that is formed by combining the contents of the maps supplied in the {{Code|$maps}} argument. It is equivalent to calling the two-argument form of the function with the default collation from the static context as the second argument.The two-argument form of the function returns a ''map'' that is formed by combining the contents of the maps supplied in the {{Code|$maps}} argument. The collation of the new map is the value of the {{Code|$coll}} argument. The supplied 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 with {{Code|$coll}} as the collation.# The associated value for each such key is taken from the last map in the input sequence {{Code|$maps}} that contains an entry with this key. If this map contains more than one entry with this key (which can happen if its collation is different from that of the new map) then it is ''implementation-dependent'' which of them is selected.
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.
|-
| '''Summary'''
| Constructs a new map by removing an entry from an existing map. The collation of the new map is the same as the collation of the map supplied as {{Code|$map}}. The entries in the new map correspond to the entries of {{Code|$map}}, excluding any entry whose key is equal to {{Code|$key}}.
No failure occurs if the input map contains no entry with the supplied key; the input map is returned unchanged
|-
* Introduction on maps moved to [[XQuery 3.1#Maps|XQuery 3.1]].
* Removed: collation support (in accordance with the latest spec).
;Version 7.8