Version:

Loading TOC...

sem.if( $condition as Boolean, $then as ValueIterator, $else as ValueIterator ) as ValueIterator

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.

Parameters | |
---|---|

$condition | The condition. |

$then | The then expression. |

$else | The else expression. |

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

Copyright © 2017 MarkLogic Corporation. MARKLOGIC is a
registered trademark of MarkLogic Corporation.

## Comments