[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?
>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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|