Loading TOC...

fn:map

fn:map(
   $function as function(item()) as item()*,
   $seq as item()*
) as item()*

Summary

Applies the function item $function to every item from the sequence $seq in turn, returning the concatenation of the resulting sequences in order. For more details, see XPath 3.0 Functions and Operators.

Parameters
function The function value.
seq The function value.

Example

fn:map(function($a) { $a * 2 }, (1 to 10))
=> (2, 4, 6, 8, 10, 12, 14, 16, 18, 20)

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