arabica/include/XSLT/impl/xslt_value_of.hpp

43 lines
1,016 B
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>
2007-07-19 19:01:42 +02:00
class ValueOf : public Item
{
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,
ExecutionContext& 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