Loading TOC...

fn:map-pairs

fn:map-pairs(
   function as function(item(), item()) as item()*,
   seq1 as item()*,
   seq2 as item()*
) as item()*

Summary

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.

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

Example

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.