diff --git a/include/XSLT/impl/xslt_execution_context.hpp b/include/XSLT/impl/xslt_execution_context.hpp index 5b2ca630..c3fc296a 100755 --- a/include/XSLT/impl/xslt_execution_context.hpp +++ b/include/XSLT/impl/xslt_execution_context.hpp @@ -40,7 +40,7 @@ public: stylesheet_(stylesheet), sink_(output.asOutput()), message_sink_(error_output), - variable_precendence_(0), + variable_precedence_(0), to_msg_(0) { xpathContext_.setVariableResolver(stack_); @@ -52,7 +52,7 @@ public: stack_(rhs.stack_), sink_(output.asOutput()), message_sink_(rhs.message_sink_), - variable_precendence_(rhs.variable_precendence_), + variable_precedence_(rhs.variable_precedence_), to_msg_(false) { xpathContext_.setVariableResolver(stack_); @@ -77,8 +77,8 @@ public: void unpassParam(const std::string& name); void declareParam(const DOM::Node& node, const Variable_declaration& param); void declareVariable(const DOM::Node& node, const Variable_declaration& variable); - void pushVariablePrecendence() { ++variable_precendence_; } - int variablePrecendence() { return variable_precendence_; } + void pushVariablePrecedence() { ++variable_precedence_; } + int variablePrecedence() { return variable_precedence_; } void freezeTopLevel(); void injectGlobalScope(const Scope& scope); @@ -104,7 +104,7 @@ private: private: const Stylesheet& stylesheet_; VariableStack stack_; - int variable_precendence_; + int variable_precedence_; Arabica::XPath::ExecutionContext xpathContext_; Output& sink_; StreamSink message_sink_; @@ -127,7 +127,7 @@ public: virtual const std::string& namespace_uri() const { return var_.namespace_uri(); } virtual const std::string& name() const { return var_.name(); } - virtual int precendence() const { return context_.variablePrecendence(); } + virtual int precedence() const { return context_.variablePrecedence(); } virtual Arabica::XPath::XPathValue value() const { @@ -193,7 +193,7 @@ void ExecutionContext::declareVariable(const DOM::Node& node, const void ExecutionContext::freezeTopLevel() { stack_.freezeTopLevel(); - variable_precendence_ = 0; + variable_precedence_ = -1; } // freezeTopLevel void ExecutionContext::injectGlobalScope(const Scope& scope) diff --git a/include/XSLT/impl/xslt_stylesheet.hpp b/include/XSLT/impl/xslt_stylesheet.hpp index c036388d..750e79c9 100755 --- a/include/XSLT/impl/xslt_stylesheet.hpp +++ b/include/XSLT/impl/xslt_stylesheet.hpp @@ -85,7 +85,7 @@ public: { for(ItemList::const_iterator ci = isi->begin(), ce = isi->end(); ci != ce; ++ci) (*ci)->execute(initialNode, context); - context.pushVariablePrecendence(); + context.pushVariablePrecedence(); } // for ... context.freezeTopLevel(); diff --git a/include/XSLT/impl/xslt_variable_stack.hpp b/include/XSLT/impl/xslt_variable_stack.hpp index 6df80114..e7247eb6 100755 --- a/include/XSLT/impl/xslt_variable_stack.hpp +++ b/include/XSLT/impl/xslt_variable_stack.hpp @@ -22,7 +22,7 @@ public: virtual const std::string& namespace_uri() const = 0; virtual const std::string& name() const = 0; - virtual int precendence() const = 0; + virtual int precedence() const = 0; virtual Arabica::XPath::XPathValue value() const = 0; virtual void injectGlobalScope(const Scope& scope) const = 0; @@ -32,7 +32,7 @@ private: Variable_instance& operator=(const Variable_instance&); bool operator==(const Variable_instance&) const; - int precendence_; + int precedence_; }; // Variable_instance class VariableStack : public Arabica::XPath::VariableResolver @@ -108,10 +108,10 @@ public: if(stack.find(name) != stack.end()) { - int current_p = stack[name]->precendence(); - if(var->precendence() == current_p) + int current_p = stack[name]->precedence(); + if(var->precedence() == current_p) throw std::runtime_error("Duplicate variable name : " + clarkName(var)); - if(var->precendence() > current_p) + if(var->precedence() > current_p) return; } // if ...