Back to Aurora Vision Library website

You are here: Start » Function Reference » All Functions » Xml » Xml_SelectSingleAttribute_AsBool

Xml_SelectSingleAttribute_AsBool


This is Filter Equivalent. This function may be present in generated code, but should not be used in hand-written code.

Header: STD.h
Namespace: avl
Module: FoundationLite

Selects attribute from the XML tree using XPath request.

Syntax

void avl::Xml_SelectSingleAttribute_AsBool
(
	const avl::XmlNode& inNode,
	const atl::String& inXPath,
	const atl::Optional<bool&> inDefault,
	atl::String& outAttributeName,
	bool& outAttributeValue
)

Parameters

Name Type Default Description
Input value inNode const XmlNode& Source node.
Input value inXPath const String& XPath criteria.
Input value inDefault const Optional<bool&> NIL If set this value will be returned when no attribute is found or attribute is incorrect.
Output value outAttributeName String& Found attribute name.
Output value outAttributeValue bool& Found attribute value as bool.

Description

Filter finds attribute using provided XPath query. Found attribute value is converted to Bool type.

Filter checks only first character of selected node's attribute. Characters Y, y, T, t, 1 will be parsed as True value. Value False will be returned if one of characters N, n, F, f, 0 will be found.

In case when attribute value cannot be parsed or attribute is empty a default value is returned if is set. Otherwise an exception is thrown.

In case when attribute is missing and default value is set a default value is returned. Otherwise an exception is thrown.

See Also