[Home] [By Thread] [By Date] [Recent Entries]
>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
|

Cart



