Returns valueTrue if the Boolean condition is true, and valueFalse if false. Only the selected subexpression is evaluated. Both subexpressions must be of the same type, which is also the return type.
if(condition:Boolean, valueTrue:any type, valueFalse:any type) -> any type |
Name |
Type |
Description |
---|---|---|
condition |
Boolean |
Specifies the condition to evaluate. |
valueTrue |
any type |
Specifies a subexpression to return when condition evaluates to true. |
valueFalse |
any type |
Specifies a subexpression to return when condition evaluates to false. |
The following expression passes a Boolean as XML Schema conformant value:
if(b, "true", "false") |
An alternative way to do this:
if(b, "1", "0") |