W3C home > Mailing lists > Public > public-qt-comments@w3.org > May 2007

Re: [XSLTerrata] Undocumented xsl:sort/@lang incompatibility?

From: Tony Graham <Tony.Graham@MenteithConsulting.com>
Date: Mon, 28 May 2007 10:16:41 +0100
To: <public-qt-comments@w3.org>
Message-ID: <874plx8g06.fsf@zako.menteithconsulting.com>

On Mon, May 28 2007 00:23:03 +0100, Michael Kay wrote:
> In my view this is a product issue and not a spec issue. A product that
> chooses to maintain backwards-compatibility here can do so while remaining
> both within the letter and the spirit of both specifications. The spec
> doesn't require products to be backwards-compatible, but that's true
> wherever things are implementation-defined. 

I am not saying that a product should be required to maintain
backwards compatibility when 'lang' is not specified.  I don't even
think it would be a good idea.

Collations allow much better control of sorting than does specifying a
single language code, and defaulting the language from the system
environment does mean that people in different parts of the world can
get different results for the same input.  (For an implementation to
choose to default to the Unicode codepoint collation makes sense since
it has to be implemented anyway, it is easily understood, it gives
consistent results in any environment, and it is likely to be fast.)

I was merely asking whether the different expectations in the absence
of the 'lang' attribute on xsl:sort should be noted in Appendix J.

Regards,


Tony Graham.

> Incidentally, even if the rules for selecting a language were identical
> between XSLT 1.0 and 2.0 and completely prescriptive in both cases, that
> would not guarantee compatible behaviour: for some languages (Swedish is an
> example) the Java collation rules changed between JDK 1.4 and JDK 1.5, so
> you can actually get incompatible behaviour from the same XSLT
> processor/version depending on which JDK you are using.
>
> In the case of Saxon, a change in default behaviour was introduced in
> version 8.8 and announced in the release documentation
>
> http://www.saxonica.com/documentation/changes/intro88/xslt88.html
>
> together with instructions on how to retain the previous default behaviour.
>
> Michael Kay
> http://www.saxonica.com/
>
>
>> -----Original Message-----
>> From: public-qt-comments-request@w3.org 
>> [mailto:public-qt-comments-request@w3.org] On Behalf Of Tony Graham
>> Sent: 27 May 2007 20:59
>> To: public-qt-comments@w3.org
>> Subject: [XSLTerrata] Undocumented xsl:sort/@lang incompatibility?
>> 
>> 
>> Section 10, "Sorting", of XSLT 1.0 [1] includes:
>> 
>>    if no lang value is specified, the language should be determined
>>    from the system environment
>> 
>> Section 13.1.3 "Sorting Using Collations", of XSLT 2.0 [2] includes:
>> 
>>    If none of the collation, lang or case-order attributes is present,
>>    the collation is chosen in an implementation-defined way.
>> 
>> This difference in expectation in the absence of the 'lang' 
>> attribute (which recently caused unexpected results for me) 
>> is not listed in Appendix J, "Changes from XSLT 1.0 
>> (Non-Normative)", of XSLT 2.0 [3].
>> Should it be?
>> 
>> Regards,
>> 
>> 
>> 
>> Tony Graham.
>> ======================================================================
>> Tony.Graham@MenteithConsulting.com   http://www.menteithconsulting.com
>> 
>> Menteith Consulting Ltd             Registered in Ireland - No. 428599
>> Registered Office: 13 Kelly's Bay Beach, Skerries, Co. 
>> Dublin, Ireland 
>> ======================================================================
>> 
>> [1] http://www.w3.org/TR/xslt#sorting
>> [2] http://www.w3.org/TR/2007/REC-xslt20-20070123/#xsl-sort
>> [3] http://www.w3.org/TR/2007/REC-xslt20-20070123/#changes
>> 
>

======================================================================
Tony.Graham@MenteithConsulting.com   http://www.menteithconsulting.com

Menteith Consulting Ltd             Registered in Ireland - No. 428599
Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
======================================================================
Received on Monday, 28 May 2007 09:17:31 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:18 UTC