arabica/include/XSLT/impl/xslt_top_level_param.hpp

53 lines
1.8 KiB
C++
Raw Normal View History

2007-07-19 19:01:42 +02:00
#ifndef ARABICA_XSLT_TOP_LEVEL_PARAM_HPP
#define ARABICA_XSLT_TOP_LEVEL_PARAM_HPP
namespace Arabica
{
namespace XSLT
{
2012-11-06 09:20:10 +01:00
template<class string_type, class string_adaptor>
2012-11-06 21:25:10 +01:00
class TopLevelParam : public Variable_declaration<string_type, string_adaptor>
2007-07-19 19:01:42 +02:00
{
public:
2012-11-06 09:20:10 +01:00
TopLevelParam(const string_type& namespace_uri,
const string_type& name,
Arabica::XPath::XPathValue<string_type, string_adaptor> value) :
2007-07-19 19:01:42 +02:00
namespace_uri_(namespace_uri),
name_(name),
value_(value)
{
} // TopLevelParam
virtual ~TopLevelParam() { }
2012-11-08 18:13:33 +01:00
virtual void declare(ExecutionContext<string_type, string_adaptor>& context) const
2007-07-19 19:01:42 +02:00
{
context.topLevelParam(null_node, *this);
} // declare
2012-11-06 09:20:10 +01:00
virtual const string_type& namespace_uri() const { return namespace_uri_; }
virtual const string_type& name() const { return name_; }
virtual Arabica::XPath::XPathValue<string_type, string_adaptor> value(const DOM::Node<string_type, string_adaptor>& /* node */,
2012-11-08 18:13:33 +01:00
ExecutionContext<string_type, string_adaptor>& /* context */,
2012-11-06 20:29:22 +01:00
DOMSink<string_type, string_adaptor>& /* sink */) const
2007-07-19 19:01:42 +02:00
{
return value_;
} // value
virtual const Precedence& precedence() const { return Precedence::InitialPrecedence(); }
2007-07-19 19:01:42 +02:00
private:
2012-11-06 09:20:10 +01:00
static DOM::Node<string_type, string_adaptor> null_node;
string_type namespace_uri_;
string_type name_;
Arabica::XPath::XPathValue<string_type, string_adaptor> value_;
2007-07-19 19:01:42 +02:00
}; // class TopLevelParam
2012-11-06 09:20:10 +01:00
template<class string_type, class string_adaptor>
DOM::Node<string_type, string_adaptor> TopLevelParam<string_type, string_adaptor>::null_node;
2007-07-19 19:01:42 +02:00
} // namespace XSLT
} // namespace Arabica
#endif