-
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
There is a need to get a sequence of properties from a map and indexes from an array.
TODO: There might be an obvious and simpler solution to this problem
xquery version "3.1";
declare function local:map-get-sequence ($map as map(*), $keys as xs:anyAtomicType* ) as item()* {
for-each($keys, map:get($map, ?))
};
map { 1:2, 3:4, 5:6 } => local:map-get-sequence((1, 4, 5))
(: returns (2, 6) :)xquery version "3.1";
declare function local:array-get-sequence ($array as array(*), $indexes as xs:integer* ) as item()* {
for-each($indexes, array:get($array, ?))
};
[2, 4, 6] => local:array-get-sequence((1, 3))
(: returns (2, 6) :)joewiz
Metadata
Metadata
Assignees
Labels
No labels