[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: for-each-group grouping accented versions of lette
On Sat, Apr 21, 2012 at 03:02:22AM +0200, Imsieke, Gerrit, le-tex scripsit: > You can strip the accents by unicode decomposition and then removing > the diacritical marks: > > <xsl:for-each-group select="index-0" > group-by="substring( > upper-case( > replace( > normalize-unicode(heading, 'NFKD'), > '[̀-ͯ]', > '' > ) > ), 1, 1 > )"> > <xsl:sort select="current-grouping-key()"/> Thank you! I had tried decomposing, using replace with \p{Lm} and then recomposing with NFKC, and that didn't work, but it was also fairly late on Friday afternoon. > When writing the group (= starting letter) to an output file further > down in you template, you should sort it according to the > upper-case(b&) part as first sort key, then according to the actual > heading as a second (tie-breaker) sort key. > > So itbs best to make a function (call it, e.g., my:sortkey) out of > upper-case(b&). Yes. > In that function, you can also do other useful stuff, such as > eliminating stop words or replacing all numbers with a zero, so that > everything that starts with a number will be in the same group. Fortunately these are very uncomplicated headings, so no stop words, but the point about numbers is very well taken. Thanks! Graydon
|
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
|