RE: [xsl] xsl:sort/@case-order feature missed

Subject: RE: [xsl] xsl:sort/@case-order feature missed
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Thu, 31 Jan 2002 15:53:33 -0000


> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Jonathan
> Perret
> Sent: 31 January 2002 14:41
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [xsl] xsl:sort/@case-order feature missed
>
>
> I only have the first edition of the XSLT programmer's reference,
> so maybe this has changed, but mine says for the meaning
> of case-order :
> "Defines whether upper-case letters are to be collated before
> or after lower-case letters. The default is language-dependant."


This is almost exactly the language used in the spec itself. I don't think
it means that the default must be equivalent to one of the values
upper-first or lower-first.
>
> The language that is referred to here can only be the one that
> is specified by xsl:sort's lang attribute, given that it seems
> hard to define what happens when sorting elements that
> bear different xml:lang attributes.

Yes: the lang attribute, or the default language used in its absence. But
since the statement that "the default is language-dependant" is essentially
untestable, I interpret it to mean that in the absence of the case-order
attribute, the implementor can do what he likes.
>
> So if you don't specify case-order, you should get either the
> upper-first or the lower-first behavior, depending on the
> lang attribute. I think that's what "case-order effective value"
> means. There does not seem to be a way to sort in
> document-order strings that only differ in case.
> >
> If there was an uppercase() function (is there one in XSLT 2 ?)
> this would get you the desired order :
>
> <xsl:sort select="uppercase(...)" />
>
XSLT 2.0 provides the ability to invoke a named collating sequence when
sorting. It's up to the implementor to provide mechanisms for defining named
collating sequences. Saxon 7.0 does it by exposing the Java collation
mechanisms.

And there are functions to convert to upper or lower case as well.

Mike Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread