XPathAtomicValue.EffectiveBooleanValue MethodXPathAtomicValue.EffectiveBooleanValue MethodXPathAtomicValue::EffectiveBooleanValue Method
Returns the effective boolean value of this item.
Return Value
Type: System.BooleanSystem.BooleanSystem::Boolean
The effective boolean value of this item.
Exceptions
Exception | Condition |
NotSupportedExceptionNotSupportedExceptionNotSupportedException | Thrown if the current item is not a valid argument to xs:boolean . |
Remarks
The effective boolean value of an item is computed as follows:
- If the item is of type
xs:boolean
or derived fromxs:boolean
, returns the ValueAsBooleanValueAsBooleanValueAsBoolean. - If the item is of type
xs:string
,xs:anyURI
,xs:untypedAtomic
, or a type derived from one of these, returnsfalse
False
false
if the value has zero length; otherwise it returnstrue
True
true
. - If the item is of any numeric type or derived from a numeric type, returns
false
False
false
if the operand value isNaN
or is numerically equal to zero; otherwise it returnstrue
True
true
. - In all other cases, EffectiveBooleanValueEffectiveBooleanValueEffectiveBooleanValue raises an exception.