Loading TOC...

MarkLogic 12 EA 2 Product Documentation
map:map

map:map(
   [$map as element(map:map)]
) as map:map

Summary

Creates a map.

Parameters
map A serialized map element.

Example

  map:map()
  => map:map(<map xmlns="http://marklogic.com/xdmp/map"/>)

Example

xquery version "1.0-ml";

let $map :=
<map:map xmlns:map="http://marklogic.com/xdmp/map">
 <map:entry key="2">
   <map:value xsi:type="xs:string"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    >world</map:value>
 </map:entry>
 <map:entry key="1">
   <map:value xsi:type="xs:string"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    >hello</map:value>
 </map:entry>
</map:map>
return
map:get(map:map($map), "2")
=>
world

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.