Compute effective Boolean value of a sequence of items.
The following construct(s) refer to this construct:
fn:boolean(item* $srcval) => boolean
This function returns the effective Boolean value of a sequence of items.
If the sequence is empty, the function returns
"false". If $srcval
is an
atomic value, this function returns the same value as the constructor function
xs:boolean
. In the
following cases the function returns "false":
The singleton Boolean value "false";
A singleton numeric value that is numerically equal to zero;
The empty string value "".
$srcval |
any item |
---|
boolean(24-24) boolean("24-24")
The first query returns "false", since the argument is a numerical expression that evaluates to zero. In the second query the argument is a non-empty string value, and therefore the function returns "true".