arabica/XPath/impl/xpath_variable.hpp
2005-08-16 21:04:44 +00:00

32 lines
744 B
C++

#ifndef ARABICA_XPATH_VARIABLE_HPP
#define ARABICA_XPATH_VARIABLE_HPP
#include "xpath_value.hpp"
#include "xpath_execution_context.hpp"
#include "xpath_variable_resolver.hpp"
namespace Arabica
{
namespace XPath
{
template<class string_type>
class Variable : public XPathExpression<string_type>
{
public:
Variable(const string_type& name) : name_(name) { }
virtual XPathValuePtr<string_type> evaluate(const DOM::Node<string_type>& context,
const ExecutionContext& executionContext) const
{
return executionContext.variableResolver().resolveVariable(name_);
} // evaluate
private:
const string_type name_;
}; // class Variable
} // namespace XPath
} // namespace Arabica
#endif