arabica/include/XSLT/impl/handler/xslt_message_handler.hpp

40 lines
1.4 KiB
C++
Raw Normal View History

2007-07-19 17:01:42 +00:00
#ifndef ARABICA_XSLT_MESSAGE_HANDLER_HPP
#define ARABICA_XSLT_MESSAGE_HANDLER_HPP
#include "../xslt_message.hpp"
#include "xslt_item_container_handler.hpp"
namespace Arabica
{
namespace XSLT
{
2012-11-04 17:07:41 +00:00
template<class string_type, class string_adaptor>
class MessageHandler : public ItemContainerHandler<Message<string_type, string_adaptor> >
2007-07-19 17:01:42 +00:00
{
2012-11-04 17:07:41 +00:00
typedef ItemContainerHandler<Message<string_type, string_adaptor> > baseT;
typedef StylesheetConstant<string_type, string_adaptor> SC;
2007-07-19 17:01:42 +00:00
public:
2012-11-04 17:07:41 +00:00
MessageHandler(CompilationContext<string_type, string_adaptor>& context) :
baseT(context)
2007-07-19 17:01:42 +00:00
{
} // MessageHandler
protected:
2012-11-04 17:07:41 +00:00
virtual Message<string_type, string_adaptor>* createContainer(const string_type& /* namespaceURI */,
const string_type& /* localName */,
const string_type& qName,
const SAX::Attributes<string_type, string_adaptor>& atts)
2007-07-19 17:01:42 +00:00
{
static const ValueRule<string_type> rules[] = { { SC::terminate, false, SC::no, SC::AllowedYesNo },
{ string_adaptor::empty_string(), false, 0, 0 } };
return new Message<string_type, string_adaptor>(gatherAttributes(qName, atts, rules)[SC::terminate] == SC::yes);
2007-07-19 17:01:42 +00:00
} // createContainer
}; // class MessageHandler
} // namespace XSLT
} // namespace Arabica
#endif