arabica/include/XSLT/impl/xslt_if.hpp
2007-07-19 17:01:42 +00:00

34 lines
655 B
C++
Executable file

#ifndef ARABICA_XSLT_IF_HPP
#define ARABICA_XSLT_IF_HPP
#include "xslt_item.hpp"
namespace Arabica
{
namespace XSLT
{
class If : public ItemContainer
{
public:
If(Arabica::XPath::XPathExpressionPtr<std::string> test) :
test_(test)
{
} // If
virtual ~If() { }
virtual void execute(const DOM::Node<std::string>& node, ExecutionContext& context) const
{
if(test_->evaluateAsBool(node, context.xpathContext()))
execute_children(node, context);
} // execute
private:
Arabica::XPath::XPathExpressionPtr<std::string> test_;
}; // class If
} // namespace XSLT
} // namespace Arabica
#endif