[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: alphabetic set of xsl:result-document
On 8/22/05, David Carlisle <davidc@xxxxxxxxx> wrote: > > > > The actual xslt I've been hacking has an x:replace() > > function replacing certain characters (u/v i/y thorn/th) for > > Note that the xslt2 way of doing comparisons that are insensitive to such > differences is really to specify a collation that does the right thing. > However if saxon doesn't provide (or give acces to a java) collation > that does the right thing for you that would mean writing (er something) > in java that saxon sees as a collation, in which case you might find it > easier to do a string replace within xslt. (I probably would, but my > xslt is rather better than by java). Ok, I don't know much about collations in this context. What I'm doing now is a string replace function in the xslt like: ----- <xsl:function name="x:replace"> <xsl:param name="string"/><xsl:param name="list"/> <xsl:value-of select=" if(empty($list)) then $string else x:replace(replace($string,$list[1],$list[2]),$list[position()>2])"/> </xsl:function> ----- And so using it like: <xsl:for-each-group select="//div[@type='psalm']//w" group-by="substring(x:replace(lower-case(.), ('y', 'i', 'u','v', 'þ', 'th', 'ȝ', '3', '&', '', ';', '')),1,1)"> Is there a simpler and/or better way to do this using saxon? -James -- James Cummings, Cummings dot James at GMail dot com
|
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
|