pub fn effective_boolean_value(value: &XmlValue) -> Result<bool, XPathError>Expand description
Compute the effective boolean value of an atomic XmlValue.
This implements the core EBV logic for atomic values. For sequences,
use effective_boolean_value_sequence or the iterator-based version.
§Arguments
value- The atomic value to evaluate
§Returns
Ok(bool)- The effective boolean valueErr(XPathError)- FORG0006 if the type doesn’t support EBV
§Examples
use xsd_schema::xpath::boolean::effective_boolean_value;
use xsd_schema::types::XmlValue;
assert_eq!(effective_boolean_value(&XmlValue::boolean(true)).unwrap(), true);
assert_eq!(effective_boolean_value(&XmlValue::string("")).unwrap(), false);
assert_eq!(effective_boolean_value(&XmlValue::string("hello")).unwrap(), true);