[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: <sort lang="sv"/> in Saxon

Subject: Re: <sort lang="sv"/> in Saxon
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Tue, 16 Oct 2001 09:52:44 +0100
xslt sort lang
Hi Joerg,

> I could not find anything which mandates the processor to even take
> a serious look at the language, not to mention doing anything the
> user might expect like doing the sort according to the local
> collating sequence. Is this about to change in the next release of
> the standard?

The XSLT Rec specifically states:

  lang specifies the language of the sort keys; it has the same range
  of values as xml:lang [XML]; if no lang value is specified, the
  language should be determined from the system environment

So the local collating sequence should be used if no lang attribute is
specified. (Actually, this is a bit peculiar when you consider the a,
b, c sequence - presumably there are quite a lot of languages aside
from English whose alphabetical sequences start with 'a' - should an
XSLT processor use the local language (if it knows how) or should it
always use the English sequence (specified earlier in the Rec)?)

The Rec also warns:

  NOTE: It is possible for two conforming XSLT processors not to sort
  exactly the same. Some XSLT processors may not support some
  languages. Furthermore, there may be variations possible in the
  sorting of any particular language that are not specified by the
  attributes on xsl:sort, for example, whether Hiragana or Katakana is
  sorted first in Japanese. Future versions of XSLT may provide
  additional attributes to provide control over these variations.
  Implementations may also use implementation-specific namespaced
  attributes on xsl:sort for this.

  NOTE: It is recommended that implementers consult [UNICODE TR10] for
  information on internationalized sorting.

The fact is that sorting according to different languages isn't
straight-forward. There are so many possible languages (especially
when you consider alphabetic/traditional orders as well) that it's a
massive burden to expect every processor to support *every* language.
So I doubt that XSLT 2.0 will make any major changes to the
requirements for language support in XSLT processors.

> And, just for curiosity, does anybody know the rationale for
> inventing the xsl:lang attribute rather than using xml:lang?

*Probably* it's to do with the fact that xml:lang is designed to
indicate the language used by the element content/attribute values on
an element. xsl:sort doesn't have any content; if you used xml:lang it
would be to do things like:

  <xsl:sort xml:lang="fr" order="descente" />

(xsl:)lang, on the other hand, is indicating the language of the sort
values, which is a uniquely XSLT concept.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.