summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-11-08 14:34:59 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-11-08 14:34:59 +0000
commit6783bf0c322e01ce23669730e6b35b3bafdf85b1 (patch)
tree7bbe5235ab082886a7e3f066f3990bab21e076d2
parent74737f97ba86199fb2be4ae91a2d0f3743c9a5e5 (diff)
XPath: evaluate_node_set (and select_nodes/select_single_node) now throw exception if expression return type is not node set (instead of assertion)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@223 99668b35-9821-0410-8761-19e4c4f06640
-rw-r--r--src/pugixpath.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pugixpath.cpp b/src/pugixpath.cpp
index 27a11d7..f2e051c 100644
--- a/src/pugixpath.cpp
+++ b/src/pugixpath.cpp
@@ -3679,6 +3679,7 @@ namespace pugi
xpath_node_set xpath_query::evaluate_node_set(const xml_node& n) const
{
if (!m_root) return xpath_node_set();
+ if (m_root->rettype() != ast_type_node_set) throw xpath_exception("Expression does not evaluate to node set");
xpath_context c;