Skip to main content

Module boolean

Module boolean 

Source
Expand description

Boolean operations for XPath evaluation.

This module implements the XPath 2.0 effective boolean value (EBV) rules as defined in the XPath 2.0 specification section 2.4.3.

§Effective Boolean Value Rules

The effective boolean value of a value is determined as follows:

  • If the value is an empty sequence, EBV is false
  • If the value is a single node, EBV is true
  • If the value is a singleton xs:boolean, EBV is the value
  • If the value is a singleton xs:string/xs:untypedAtomic/xs:anyURI, EBV is !value.is_empty()
  • If the value is a singleton numeric type, EBV is value != 0 && !value.is_nan()
  • For other atomic types or sequences of length > 1, a type error is raised

Functions§

effective_boolean_value
Compute the effective boolean value of an atomic XmlValue.
effective_boolean_value_opt
Compute the effective boolean value with support for optional values.
is_numeric_type
Check if a type code represents a numeric type.
is_string_like_type
Check if a type code represents a string-like type.
not
Logical NOT operation on an XPath value.
not_opt
Logical NOT with optional value support.
supports_ebv
Check if a type code supports effective boolean value.