declare function local:foo($item as array(*)){ let $f:=$item(1) let $v:=$item(2) return array:for-each($v, function($q){ [$f,$q] }) ?* };
(["f", [1, 2, 3]], ["g", [4, 5]]) ! local:foo(.)
declare function local:foo($item as array(*)){ let $f:=$item(1) let $v:=$item(2) return array:for-each($v, function($q){ [$f,$q] }) ?* };
(["f", [1, 2, 3]], ["g", [4, 5]]) ! local:foo(.)
I am still looking for further clarification according to affected implementation details.
* I would appreciate also if the declaration of such callback functions can be described better in published software documentation for the programming language “XQuery”.
* How would you convert the constructed array to a CSV file format?
* How should similar for-each operations be performed for other data structures (besides arrays)?
* Would you like to compare run time characteristics any more for such data processing?
Regards, Markus