From ca3f051fbf42b9abf7c22e3f58215cf5010f9727 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Fri, 24 Sep 2010 05:37:50 +0000 Subject: docs: Removed pugixpath.cpp mentions, updated evaluate_* arguments and added xpath_node ctor clarification, updated custom memory management description, updated CDATA printing information, added wide load_file/save_file documentation, added as_utf8/as_wide string overloads, fixed xml_node::root() complexity git-svn-id: http://pugixml.googlecode.com/svn/trunk@752 99668b35-9821-0410-8761-19e4c4f06640 --- docs/manual/xpath.html | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) (limited to 'docs/manual/xpath.html') diff --git a/docs/manual/xpath.html b/docs/manual/xpath.html index 731a969..513bb90 100644 --- a/docs/manual/xpath.html +++ b/docs/manual/xpath.html @@ -54,6 +54,9 @@ at tizag.com, and the XPath 1.0 specification.

+

+ $$ +

@@ -120,9 +123,11 @@ You can also create XPath nodes with one of tree constructors: the default constructor, the constructor that takes node argument, and the constructor that takes attribute and node arguments (in which case the attribute must - belong to the attribute list of the node). However, usually you don't need - to create your own XPath node objects, since they are returned to you via - selection functions. + belong to the attribute list of the node). The constructor from xml_node is implicit, so you can usually + pass xml_node to functions + that expect xpath_node. Apart + from that you usually don't need to create your own XPath node objects, since + they are returned to you via selection functions.

XPath expressions operate not on single nodes, but instead on node sets. @@ -309,20 +314,21 @@

You can evaluate the query using one of the following functions:

-
bool xpath_query::evaluate_boolean(const xml_node& n) const;
-double xpath_query::evaluate_number(const xml_node& n) const;
-string_t xpath_query::evaluate_string(const xml_node& n) const;
-xpath_node_set xpath_query::evaluate_node_set(const xml_node& n) const;
+
bool xpath_query::evaluate_boolean(const xpath_node& n) const;
+double xpath_query::evaluate_number(const xpath_node& n) const;
+string_t xpath_query::evaluate_string(const xpath_node& n) const;
+xpath_node_set xpath_query::evaluate_node_set(const xpath_node& n) const;
 

- All functions take the context node as an argument, compute the expression - and return the result, converted to the requested type. By XPath specification, - value of any type can be converted to boolean, number or string value, but - no type other than node set can be converted to node set. Because of this, - evaluate_boolean, evaluate_number and evaluate_string - always return a result, but evaluate_node_set - throws an xpath_exception - if the return type is not node set. + $$ exception, evaluate_string nostl All functions take the context node as + an argument, compute the expression and return the result, converted to the + requested type. By XPath specification, value of any type can be converted + to boolean, number or string value, but no type other than node set can be + converted to node set. Because of this, evaluate_boolean, + evaluate_number and evaluate_string always return a result, + but evaluate_node_set throws + an xpath_exception if the + return type is not node set.

[Note]
@@ -370,7 +376,7 @@ Error handling

- As of version 0.9, all XPath errors result in thrown exceptions. The errors + $$ As of version 0.9, all XPath errors result in thrown exceptions. The errors can arise during expression compilation or node set evaluation. In both cases, an xpath_exception object is thrown. This is an exception object that implements std::exception @@ -379,8 +385,8 @@

virtual const char* xpath_exception::what() const throw();
 

- This function returns the error message. Currently it is impossible to get - the exact place where query compilation failed. This functionality, along + $$ This function returns the error message. Currently it is impossible to + get the exact place where query compilation failed. This functionality, along with optional error handling without exceptions, will be available in version 1.0.

@@ -464,7 +470,7 @@

- Some of these incompatibilities will be fixed in version 1.0. + $$ Some of these incompatibilities will be fixed in version 1.0.

-- cgit v1.2.3