Loading TOC...

fn:filter

fn:filter(
   $function as function(item()) as xs:boolean,
   $seq as item()*
) as item()*

Summary

Returns those items from the sequence $seq for which the supplied function $function returns true. For more details, see XPath 3.0 Functions and Operators.

Parameters
function The function value.
seq The function value.

Example

fn:filter(function($a) { $a mod 2 = 0 }, (1 to 10))
=> (2, 4, 6, 8, 10)

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