XPathAtomicValue.EffectiveBooleanValue MethodXPathAtomicValue.EffectiveBooleanValue MethodXPathAtomicValue::EffectiveBooleanValue Method

Returns the effective boolean value of this item.

Syntax

Public Overridable Function EffectiveBooleanValue() As Boolean
public virtual bool EffectiveBooleanValue()
public:
virtual bool EffectiveBooleanValue()
 

Return Value

Type: System.BooleanSystem.BooleanSystem::Boolean

The effective boolean value of this item.

Exceptions

ExceptionCondition
NotSupportedExceptionNotSupportedExceptionNotSupportedExceptionThrown if the current item is not a valid argument to xs:boolean.

Remarks

The effective boolean value of an item is computed as follows:

  1. If the item is of type xs:boolean or derived from xs:boolean, returns the ValueAsBooleanValueAsBooleanValueAsBoolean.
  2. If the item is of type xs:string, xs:anyURI, xs:untypedAtomic, or a type derived from one of these, returns falseFalsefalse if the value has zero length; otherwise it returns trueTruetrue.
  3. If the item is of any numeric type or derived from a numeric type, returns falseFalsefalse if the operand value is NaN or is numerically equal to zero; otherwise it returns trueTruetrue.
  4. In all other cases, EffectiveBooleanValueEffectiveBooleanValueEffectiveBooleanValue raises an exception.