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

Re: Can group-by treat its target it two ways?

Subject: Re: Can group-by treat its target it two ways?
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Sat, 05 Nov 2011 18:10:03 +0000
Re:  Can group-by treat its target it two ways?
>How can I make <xsl:for-each-group select="Word" group-by="lower-case(substring(@word,1,1))"> consider 'ch' as a single letter?

You can of course handle the special case as you do in your follow-up post, but I don't think there's a general solution in XSLT.

At the Java level, you can get a RuleBasedCollator for a given language, and you can create a CollationElementIterator that iterates over the collation units of a string given this collator; in your example the first collation unit will be 'ch'. I think there's enough information in the CollationElementIterator to support an extension function

collation-units(string, collation) -> string*

that splits any string into its collation units; and then you could of course do group-by="collation-units(., $czech-collation)[1]".

So I think it's possible in theory!

Michael Kay
Saxonica

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.