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

Re: Use the xml:lang attribute to set the collation?

Subject: Re: Use the xml:lang attribute to set the collation?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 07 Jan 2013 15:36:15 +0000
Re:  Use the xml:lang attribute to set the collation?
On 07/01/2013 15:28, Costello, Roger L. wrote:
Hi Folks,

Michael Kay wrote this response to a StackOverflow question [1]:

Saxon's default collation is Unicode codepoint, which is fast but not
smart. Setting lang="en" will immediately give you a smarter
natural-language collation. There are then many options to refine it
further.

QUESTIONS 1. Does Michael's response mean that, to set the collation,
I can use the xml:lang attribute instead of the default-collation
attribute?

No, lang not xml:lang as an attribute of xsl:sort

2. Would you please give an example of a comparison where the result of the comparison is true when xml:lang="A" but false when xml:lang="B"? That is, what values would you place in here:

in the default unicode code point order A-Z come before a-z so Zebra comes before apple

If lang="en" then a and A are before z and Z (in the collation that saxon uses in that case)

so Zebra comes after apple


<Test xml:lang="__"> <xsl:value-of select=" '__' lt '__' " /> </Test>


If you are using lt rather than xsl:sort I think you need to set the collation URI explicitly rather than use lang.
/Roger

[1]
http://stackoverflow.com/questions/13052896/xslt-sort-edge-case-for-ascending-sort-by-element-name

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.