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>
|
2007-07-19 19:01:42 +02:00
|
|
|
class TopLevelParam : public Variable_declaration
|
|
|
|
{
|
|
|
|
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() { }
|
|
|
|
|
|
|
|
virtual void declare(ExecutionContext& context) const
|
|
|
|
{
|
|
|
|
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 */,
|
2010-01-11 10:02:17 +01:00
|
|
|
ExecutionContext& /* context */,
|
|
|
|
DOMSink& /* sink */) const
|
2007-07-19 19:01:42 +02:00
|
|
|
{
|
|
|
|
return value_;
|
|
|
|
} // value
|
2008-11-19 18:26:07 +01:00
|
|
|
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
|
|
|
|
|