diff --git a/XPath/impl/xpath_step.hpp b/XPath/impl/xpath_step.hpp index 8f7d09cf..56315b5c 100644 --- a/XPath/impl/xpath_step.hpp +++ b/XPath/impl/xpath_step.hpp @@ -118,6 +118,7 @@ private: const ExecutionContext& parentContext) const { AxisEnumerator enumerator(context, axis_); + results.forward(enumerator.forward()); NodeSet intermediate(enumerator.forward()); NodeSet& d = (!baseT::has_predicates()) ? results : intermediate; while(*enumerator != 0) @@ -130,14 +131,11 @@ private: } // while ... if(!baseT::has_predicates()) - { - results.forward(enumerator.forward()); return; - } // if ... intermediate = baseT::applyPredicates(intermediate, parentContext); - results.swap(intermediate); + results.insert(results.end(), intermediate.begin(), intermediate.end()); } // enumerateOver Axis axis_;