From bbafbf4b6345740e0c70b3621db7cfebca7be117 Mon Sep 17 00:00:00 2001 From: Jez Higgins Date: Tue, 6 Nov 2012 08:20:10 +0000 Subject: [PATCH] toplevel param --- .../XSLT/impl/xslt_compiled_stylesheet.hpp | 6 ++--- include/XSLT/impl/xslt_top_level_param.hpp | 24 ++++++++++--------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/include/XSLT/impl/xslt_compiled_stylesheet.hpp b/include/XSLT/impl/xslt_compiled_stylesheet.hpp index f7aa9ec9..2f384a62 100644 --- a/include/XSLT/impl/xslt_compiled_stylesheet.hpp +++ b/include/XSLT/impl/xslt_compiled_stylesheet.hpp @@ -273,12 +273,12 @@ private: void set_parameter(const std::string& name, Value value) { - params_.push_back(new TopLevelParam("", name, value)); + params_.push_back(new TopLevelParam >("", name, value)); } // set_parameter void set_parameter(const std::string& namespace_uri, const std::string& name, Value value) { - params_.push_back(new TopLevelParam(namespace_uri, name, value)); + params_.push_back(new TopLevelParam >(namespace_uri, name, value)); } // set_parameter private: @@ -316,7 +316,7 @@ private: typedef std::map >*> NamedTemplates; typedef std::vector VariableDeclList; - typedef std::vector ParamList; + typedef std::vector >*> ParamList; TemplateList all_templates_; NamedTemplates named_templates_; diff --git a/include/XSLT/impl/xslt_top_level_param.hpp b/include/XSLT/impl/xslt_top_level_param.hpp index d7ae5757..d1a5030a 100644 --- a/include/XSLT/impl/xslt_top_level_param.hpp +++ b/include/XSLT/impl/xslt_top_level_param.hpp @@ -6,12 +6,13 @@ namespace Arabica namespace XSLT { +template class TopLevelParam : public Variable_declaration { public: - TopLevelParam(const std::string& namespace_uri, - const std::string& name, - Arabica::XPath::XPathValue value) : + TopLevelParam(const string_type& namespace_uri, + const string_type& name, + Arabica::XPath::XPathValue value) : namespace_uri_(namespace_uri), name_(name), value_(value) @@ -25,9 +26,9 @@ public: context.topLevelParam(null_node, *this); } // declare - virtual const std::string& namespace_uri() const { return namespace_uri_; } - virtual const std::string& name() const { return name_; } - virtual Arabica::XPath::XPathValue value(const DOM::Node& /* node */, + virtual const string_type& namespace_uri() const { return namespace_uri_; } + virtual const string_type& name() const { return name_; } + virtual Arabica::XPath::XPathValue value(const DOM::Node& /* node */, ExecutionContext& /* context */, DOMSink& /* sink */) const { @@ -36,13 +37,14 @@ public: virtual const Precedence& precedence() const { return Precedence::InitialPrecedence(); } private: - static DOM::Node null_node; - std::string namespace_uri_; - std::string name_; - Arabica::XPath::XPathValue value_; + static DOM::Node null_node; + string_type namespace_uri_; + string_type name_; + Arabica::XPath::XPathValue value_; }; // class TopLevelParam -DOM::Node TopLevelParam::null_node; +template +DOM::Node TopLevelParam::null_node; } // namespace XSLT } // namespace Arabica