map:entry
( $key
as xs:anyAtomicType
,$value
as item()*
map(*)
The function map:entry
returns a map which normally contains 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
$key
, and its associated value is $value
.
If the supplied key is the xs:float
or
xs:double
value NaN
, the supplied $map
is
empty (that is, it contains no entries).
If the supplied key is xs:untypedAtomic
, it is converted
to xs:string
.
The expression map:entry("M", "Monday")
returns map{"M":"Monday"}
.
The function call map:entry(K, V)
produces the same result as the
expression map{K : V}
.
The function map:entry
is intended primarily for use in conjunction with
the function map:merge
. For example, a map containing seven entries may be
constructed like this:
The map:merge
function can be used to construct
a map with a variable number of entries, for example: