Am 16.05.2022 um 10:18 schrieb Markus Elfring:
Can you show us the input structure? A sequence of arrays with a string literal as the first array item but an element or document node as the second array item?
I stumbled on the design challenge if the sequence of nested arrays would be constructed by another FLWOR expression (instead of the mentioned test data literal).
To me that kind of array with a string literal followed by a an array of integers seemed kind of an odd data structure to start with so I would think about just adapting the original FLOWR expression to perhaps directly output XML or a sequences of maps from string to an array of integers.
But I don't see any difference in XQuery in general or for that sample you had, it doesn't really matter whether you have a literal or construct the data from another FLOWR expression.
Did you run into any problems/errors using the data from a FLOWR expression? If you need help with that perhaps show a sample and the error you got.