diff --git a/include/XSLT/impl/handler/xslt_if_handler.hpp b/include/XSLT/impl/handler/xslt_if_handler.hpp index 8a91fe25..7d2895dc 100644 --- a/include/XSLT/impl/handler/xslt_if_handler.hpp +++ b/include/XSLT/impl/handler/xslt_if_handler.hpp @@ -9,24 +9,25 @@ namespace Arabica namespace XSLT { -class IfHandler : public ItemContainerHandler +template +class IfHandler : public ItemContainerHandler > { public: - IfHandler(CompilationContext& context) : - ItemContainerHandler(context) + IfHandler(CompilationContext& context) : + ItemContainerHandler >(context) { } // IfHandler - virtual If* createContainer(const std::string& /* namespaceURI */, - const std::string& /* localName */, - const std::string& qName, - const SAX::Attributes& atts) + virtual If* createContainer(const string_type& /* namespaceURI */, + const string_type& /* localName */, + const string_type& qName, + const SAX::Attributes& atts) { static const ValueRule rules[] = { { "test", true, 0, 0 }, { 0, false, 0, 0 } }; std::string test = gatherAttributes(qName, atts, rules)["test"]; - return new If(ItemContainerHandler::context().xpath_expression(test)); + return new If(ItemContainerHandler >::context().xpath_expression(test)); } // startElement }; // class IfHandler diff --git a/include/XSLT/impl/handler/xslt_item_container_handler.hpp b/include/XSLT/impl/handler/xslt_item_container_handler.hpp index d4fdfa4e..39ceaa6f 100644 --- a/include/XSLT/impl/handler/xslt_item_container_handler.hpp +++ b/include/XSLT/impl/handler/xslt_item_container_handler.hpp @@ -149,7 +149,7 @@ const ChildElement* AllowedChildren() { "element", CreateHandler }, { "fallback", CreateHandler}, { "for-each", CreateHandler }, - { "if", CreateHandler }, + { "if", CreateHandler > > }, { "message", CreateHandler}, { "number", CreateHandler}, { "processing-instruction", CreateHandler }, diff --git a/include/XSLT/impl/xslt_if.hpp b/include/XSLT/impl/xslt_if.hpp index 008e2a7c..e4696015 100644 --- a/include/XSLT/impl/xslt_if.hpp +++ b/include/XSLT/impl/xslt_if.hpp @@ -8,17 +8,19 @@ namespace Arabica namespace XSLT { +template class If : public ItemContainer { public: - If(Arabica::XPath::XPathExpressionPtr test) : + If(Arabica::XPath::XPathExpressionPtr test) : test_(test) { } // If virtual ~If() { } - virtual void execute(const DOM::Node& node, ExecutionContext& context) const + virtual void execute(const DOM::Node& node, + ExecutionContext& context) const { ChainStackFrame frame(context); if(test_->evaluateAsBool(node, context.xpathContext())) @@ -26,7 +28,7 @@ public: } // execute private: - Arabica::XPath::XPathExpressionPtr test_; + Arabica::XPath::XPathExpressionPtr test_; }; // class If } // namespace XSLT