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 :)

This commit is contained in:
jez 2007-11-22 21:54:51 +00:00
parent ccbdeeaa41
commit 4ed4928695

View file

@ -25,6 +25,10 @@ public:
virtual void execute(const DOM::Node<std::string>& node, ExecutionContext& context) const
{
Arabica::XPath::XPathValue<std::string> 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<std::string> nodes = select_->evaluateAsNodeSet(node, context.xpathContext());
sort(node, nodes, context);