xsl-list
[Top] [All Lists]

Re: [xsl] Use the xml:lang attribute to set the collation?

2013-01-07 09:36:27
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


--~------------------------------------------------------------------

David



--
google plus: https:/profiles.google.com/d.p.carlisle

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. ________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>