Loading TOC...


   $condition as Boolean,
   $then as Sequence,
   $else as Sequence
) as Sequence


The IF function form evaluates the first argument, interprets it as a effective boolean value, then returns the value of expression2 if the EBV is true, otherwise it returns the value of expression3. Only one of expression2 and expression3 is evaluated. If evaluating the first argument raises an error, then an error is raised for the evaluation of the IF expression. This XQuery function backs up the SPARQL IF() functional form.

This function is a built-in.

$condition The condition.
$then The then expression.
$else The else expression.


sem.if( true, "This is true", "This is not true");
This is true


    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy