From 4ed4928695a65f131de3257dbea978ec5710e618 Mon Sep 17 00:00:00 2001 From: jez <> Date: Thu, 22 Nov 2007 21:54:51 +0000 Subject: [PATCH] check xsl:for-each selects a node-set, I suspect it should be able to diagnose this at compile time but it at least it fails :) --- include/XSLT/impl/xslt_for_each.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/XSLT/impl/xslt_for_each.hpp b/include/XSLT/impl/xslt_for_each.hpp index 54777593..77d43230 100755 --- a/include/XSLT/impl/xslt_for_each.hpp +++ b/include/XSLT/impl/xslt_for_each.hpp @@ -25,6 +25,10 @@ public: virtual void execute(const DOM::Node& node, ExecutionContext& context) const { + Arabica::XPath::XPathValue sel = select_->evaluate(node, context.xpathContext()); + if(sel.type() != Arabica::XPath::NODE_SET) + throw SAX::SAXException("xsl:for-each must select a node set"); + Arabica::XPath::NodeSet nodes = select_->evaluateAsNodeSet(node, context.xpathContext()); sort(node, nodes, context);