We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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) :)
The text was updated successfully, but these errors were encountered:
This does work as well:
[1,"s","s","s",5,"s","s"] => (function ($a, $s) { $a?($s) })((1,5))
Sorry, something went wrong.
It works for all function types (array and map)
map {1: "s", "s": "s", 5:"s", "a":()} => (function ($array-or-map as item(), $fields as xs:anyAtomicType*) { $array-or-map?($fields) })((1, "a"))
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: