From e95b455b83d8c1a7893c018e7fc9e30f60ab7fbf Mon Sep 17 00:00:00 2001 From: jez <> Date: Wed, 22 Aug 2007 12:23:38 +0000 Subject: [PATCH] check select returns a node-set --- include/XSLT/impl/xslt_apply_templates.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/XSLT/impl/xslt_apply_templates.hpp b/include/XSLT/impl/xslt_apply_templates.hpp index 630dbd44..0a6aaa60 100755 --- a/include/XSLT/impl/xslt_apply_templates.hpp +++ b/include/XSLT/impl/xslt_apply_templates.hpp @@ -38,7 +38,12 @@ public: for(DOM::Node n = node.getFirstChild(); n != 0; n = n.getNextSibling()) nodes.push_back(n); else - nodes = select_->evaluateAsNodeSet(node, context.xpathContext()); + { + Arabica::XPath::XPathValuePtr value = select_->evaluate(node, context.xpathContext()); + if(value->type() != Arabica::XPath::NODE_SET) + throw std::runtime_error("apply-templates select expression is not a node-set"); + nodes = value->asNodeSet(); + } sort(node, nodes, context); context.stylesheet().applyTemplates(nodes, context, mode_); } // execute