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

39 lines
1.2 KiB
C++
Raw Normal View History

2007-07-19 19:01:42 +02:00
#ifndef ARABICA_XSLT_IF_HANDLER_HPP
#define ARABICA_XSLT_IF_HANDLER_HPP
#include "../xslt_if.hpp"
#include "xslt_item_container_handler.hpp"
namespace Arabica
{
namespace XSLT
{
2012-11-02 23:56:14 +01:00
template<class string_type, class string_adaptor>
class IfHandler : public ItemContainerHandler<If<string_type, string_adaptor> >
2007-07-19 19:01:42 +02:00
{
public:
2012-11-02 23:56:14 +01:00
IfHandler(CompilationContext<string_type, string_adaptor>& context) :
ItemContainerHandler<If<string_type, string_adaptor> >(context)
2007-07-19 19:01:42 +02:00
{
} // IfHandler
2012-11-02 23:56:14 +01:00
virtual If<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 19:01:42 +02:00
{
2010-01-10 23:02:43 +01:00
static const ValueRule rules[] = { { "test", true, 0, 0 },
{ 0, false, 0, 0 } };
2007-07-19 19:01:42 +02:00
std::string test = gatherAttributes(qName, atts, rules)["test"];
2012-11-02 23:56:14 +01:00
return new If<string_type, string_adaptor>(ItemContainerHandler<If<string_type, string_adaptor> >::context().xpath_expression(test));
2007-07-19 19:01:42 +02:00
} // startElement
}; // class IfHandler
} // namespace XSLT
} // namespace Arabica
#endif