let $map := map { 'R': 'red', 'G': 'green', 'B': 'blue' }
return (
$map ?* (: 1. returns all values :), $map ?R (: 2. returns the value associated with the key 'R'; equivalent to $map('R') :), $map ?('G','B') (: 4. returns the values associated with the key 'G' and 'B' :)
),
let $array := [ 'one', 'two', 'three' ]
return (
$array ?* (: 1. returns all values :), $array ?1 (: 3. returns the first value; equivalent to $array(2) :), $array ?(2 to 3) (: 4. returns the values 2 and 3 :)
)
</pre>