Loading TOC...

MarkLogic 10 Product Documentation
fn:fold-right

fn:fold-right(
   $function as function(item(), item()*) as item()*,
   $zero as item()*,
   $seq as item()*
) as item()*

Summary

Processes the supplied sequence from right to left, applying the supplied function repeatedly to each item in turn, together with an accumulated result value. For more details, see XPath 3.0 Functions and Operators.

Parameters
function The fold function value.
zero The zero argument.
seq The sequence to fold

Example

fn:fold-right(function($z, $a) { $z || "," || $a }, ">>", ("a","b","c"))
=> "a,b,c,>>"

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