2005-08-04 22:42:30 +02:00
|
|
|
#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
|
|
|
|
{
|
|
|
|
|
|
|
|
class Variable : public XPathExpression
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Variable(const std::string& name) : name_(name) { }
|
|
|
|
|
2005-08-16 17:29:02 +02:00
|
|
|
virtual XPathValuePtr<std::string> evaluate(const DOM::Node<std::string>& context,
|
|
|
|
const ExecutionContext& executionContext) const
|
2005-08-04 22:42:30 +02:00
|
|
|
{
|
|
|
|
return executionContext.variableResolver().resolveVariable(name_);
|
|
|
|
} // evaluate
|
|
|
|
|
|
|
|
private:
|
|
|
|
const std::string name_;
|
|
|
|
}; // class Variable
|
|
|
|
|
|
|
|
} // namespace XPath
|
|
|
|
} // namespace Arabica
|
|
|
|
|
|
|
|
#endif
|