diff --git a/include/XSLT/impl/handler/xslt_item_container_handler.hpp b/include/XSLT/impl/handler/xslt_item_container_handler.hpp index 944870a6..e39bbbef 100644 --- a/include/XSLT/impl/handler/xslt_item_container_handler.hpp +++ b/include/XSLT/impl/handler/xslt_item_container_handler.hpp @@ -150,7 +150,7 @@ const ChildElement* AllowedChildren() { "fallback", CreateHandler > >}, { "for-each", CreateHandler > > }, { "if", CreateHandler > > }, - { "message", CreateHandler}, + { "message", CreateHandler > >}, { "number", CreateHandler > >}, { "processing-instruction", CreateHandler > > }, { "text", CreateHandler > > }, diff --git a/include/XSLT/impl/handler/xslt_message_handler.hpp b/include/XSLT/impl/handler/xslt_message_handler.hpp index 692df3d5..bdc85098 100644 --- a/include/XSLT/impl/handler/xslt_message_handler.hpp +++ b/include/XSLT/impl/handler/xslt_message_handler.hpp @@ -9,23 +9,25 @@ namespace Arabica namespace XSLT { -class MessageHandler : public ItemContainerHandler +template +class MessageHandler : public ItemContainerHandler > { + typedef ItemContainerHandler > baseT; public: - MessageHandler(CompilationContext& context) : - ItemContainerHandler(context) + MessageHandler(CompilationContext& context) : + baseT(context) { } // MessageHandler protected: - virtual Message* createContainer(const std::string& /* namespaceURI */, - const std::string& /* localName */, - const std::string& qName, - const SAX::Attributes& atts) + virtual Message* createContainer(const string_type& /* namespaceURI */, + const string_type& /* localName */, + const string_type& qName, + const SAX::Attributes& atts) { static const ValueRule rules[] = { { "terminate", false, No, AllowedYesNo }, { 0, false, 0, 0 } }; - return new Message(gatherAttributes(qName, atts, rules)["terminate"] == Yes); + return new Message(gatherAttributes(qName, atts, rules)["terminate"] == Yes); } // createContainer }; // class MessageHandler diff --git a/include/XSLT/impl/xslt_message.hpp b/include/XSLT/impl/xslt_message.hpp index 5de64387..982b2105 100644 --- a/include/XSLT/impl/xslt_message.hpp +++ b/include/XSLT/impl/xslt_message.hpp @@ -8,6 +8,7 @@ namespace Arabica namespace XSLT { +template class Message : public ItemContainer { public: @@ -18,7 +19,7 @@ public: virtual ~Message() { } - virtual void execute(const DOM::Node& node, ExecutionContext& context) const + virtual void execute(const DOM::Node& node, ExecutionContext& context) const { RedirectionFrame toMessageSink(context); execute_children(node, context); @@ -28,7 +29,7 @@ public: } // execute private: - bool terminate_; + const bool terminate_; class RedirectionFrame {