Use std::stable_sort instead of std::sort. When xsl:sort specifies a numerical sort, but you've got some string data in there we need to maintain the relative of that string data. This is the first time I've actually used std::stable_sort. I will mark it down in my big book of programming accomplishments.

This commit is contained in:
jez 2007-11-03 01:55:20 +00:00
parent a697193623
commit 2053c94f4a

View file

@ -165,7 +165,7 @@ protected:
}
sort_->set_context(node, context);
std::sort(nodes.begin(), nodes.end(), SortP(*sort_));
std::stable_sort(nodes.begin(), nodes.end(), SortP(*sort_));
} // sort
bool has_sort() const { return sort_ != 0; }