RE: [xsl] xsl:sort clarification

Subject: RE: [xsl] xsl:sort clarification
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 23 Aug 2005 00:12:23 +0100
> That does appear to be what it says, and surprisingly enough that does
> appear to be intentional, the xslt2 draft has the same wording but
> follows it by a clarifying note:
> > If two items have equal sort key values, and the sort is 
> stable, then
> > their order in the sorted sequence will be the same as 
> their order in
> > the initial sequence, regardless of whether order="descending" was
> > specified on any or all of the sort key components.

Yes. The key point here is "any or all": there can be more than one sort key
[component]. If all the sort keys are equal, and some of them are ascending
while others are descending, what order would you want for the duplicates?
In effect, there is an extra (N+1th) sort key, whose value is the position
in the initial sequence.

Michael Kay 

Current Thread