Loading TOC...


   function as function(item(), item()) as item()*,
   seq1 as item()*,
   seq2 as item()*
) as item()*


Applies the function item $function to successive pairs of items taken one from $seq1 and one from $seq2, returning the concatenation of the resulting sequences in order. For more details, see XPath 3.0 Functions and Operators.

function The map function value.
seq1 The first sequence argument.
seq2 The second sequence argument.


fn:map-pairs(function($a, $b) { $a * $b }, (1 to 10), (2 to 10))
=> (2, 6, 12, 20, 30, 42, 56, 72, 90)

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.