arabica/include/XSLT/impl/xslt_value_of.hpp

43 lines
1 KiB
C++
Raw Normal View History

2007-07-19 19:01:42 +02:00
#ifndef ARABICA_XSLT_VALUE_OF_HPP
#define ARABICA_XSLT_VALUE_OF_HPP
#include "xslt_item.hpp"
namespace Arabica
{
namespace XSLT
{
2012-11-03 00:07:17 +01:00
template<class string_type, class string_adaptor>
2012-11-08 17:18:49 +01:00
class ValueOf : public Item<string_type, string_adaptor>
2007-07-19 19:01:42 +02:00
{
public:
2012-11-03 00:07:17 +01:00
ValueOf(Arabica::XPath::XPathExpressionPtr<string_type, string_adaptor> expr,
2007-07-19 19:01:42 +02:00
bool disable_output_escaping) :
expr_(expr),
disable_(disable_output_escaping)
{
} // ValueOf
2012-11-03 00:07:17 +01:00
virtual void execute(const DOM::Node<string_type, string_adaptor>& node,
2012-11-08 18:13:33 +01:00
ExecutionContext<string_type, string_adaptor>& context) const
2007-07-19 19:01:42 +02:00
{
if(disable_)
context.sink().disableOutputEscaping(true);
context.sink().characters(expr_->evaluateAsString(node, context.xpathContext()));
if(disable_)
context.sink().disableOutputEscaping(false);
} // execute
private:
2012-11-03 00:07:17 +01:00
Arabica::XPath::XPathExpressionPtr<string_type, string_adaptor> expr_;
const bool disable_;
2007-07-19 19:01:42 +02:00
}; // class ValueOf
} // namespace XSLT
} // namespace Arabica
#endif