From 6783bf0c322e01ce23669730e6b35b3bafdf85b1 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Sun, 8 Nov 2009 14:34:59 +0000 Subject: 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 --- src/pugixpath.cpp | 1 + 1 file changed, 1 insertion(+) 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; -- cgit v1.2.3