pugi::xpath_query Class Reference

Collaboration diagram for pugi::xpath_query:

Collaboration graph
[legend]
List of all members.

Detailed Description

A class that holds compiled XPath query and allows to evaluate query result.


Public Member Functions

 xpath_query (const char *query)
 Ctor from string with XPath expression.
 ~xpath_query ()
 Dtor.
bool evaluate_boolean (const xml_node &n)
 Evaluate expression as boolean value for the context node n.
double evaluate_number (const xml_node &n)
 Evaluate expression as double value for the context node n.
std::string evaluate_string (const xml_node &n)
 Evaluate expression as string value for the context node n.
xpath_node_set evaluate_node_set (const xml_node &n)
 Evaluate expression as node set for the context node n.


Constructor & Destructor Documentation

pugi::xpath_query::xpath_query const char *  query  )  [explicit]
 

Ctor from string with XPath expression.

Throws xpath_exception on compilation error, std::bad_alloc on out of memory error.

Parameters:
query - string with XPath expression


Member Function Documentation

bool pugi::xpath_query::evaluate_boolean const xml_node n  ) 
 

Evaluate expression as boolean value for the context node n.

If expression does not directly evaluate to boolean, the expression result is converted as through boolean() XPath function call. Throws std::bad_alloc on out of memory error.

Parameters:
n - context node
Returns:
evaluation result

double pugi::xpath_query::evaluate_number const xml_node n  ) 
 

Evaluate expression as double value for the context node n.

If expression does not directly evaluate to double, the expression result is converted as through number() XPath function call. Throws std::bad_alloc on out of memory error.

Parameters:
n - context node
Returns:
evaluation result

std::string pugi::xpath_query::evaluate_string const xml_node n  ) 
 

Evaluate expression as string value for the context node n.

If expression does not directly evaluate to string, the expression result is converted as through string() XPath function call. Throws std::bad_alloc on out of memory error.

Parameters:
n - context node
Returns:
evaluation result

xpath_node_set pugi::xpath_query::evaluate_node_set const xml_node n  ) 
 

Evaluate expression as node set for the context node n.

If expression does not directly evaluate to node set, function returns empty node set. Throws std::bad_alloc on out of memory error.

Parameters:
n - context node
Returns:
evaluation result


Generated on Tue Jan 6 01:30:47 2009 for pugixml by  doxygen 1.4.6-NO