[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?
Hi Michael and Martin,
I believe you are right, no general solution exists for the reasons Michael mentioned. However, for the archives, I ended up with this monstrosity that does the job (ugly as it is): <xsl:for-each-group select="Word" group-by="if (lower-case(substring(@word,1,1)) eq 'D ' or lower-case(substring(@word,1,1)) eq 'E' or lower-case(substring(@word,1,1)) eq 'E!' or lower-case(substring(@word,1,1)) eq 'E>') then lower-case(substring(@word,1,1)) else if (lower-case(substring(@word,1,2)) eq 'ch') then 'ch' else lower-case(substring(cps:remove-diacritics(@word), 1, 1))"> <xsl:result-document href="{concat('index/cz-', current-grouping-key())}.htm"> Where cps:remove-diacritics() is defined as: <xsl:function name="cps:remove-diacritics"> <xsl:param name="in-string"/> <xsl:value-of select="replace(normalize-unicode($in-string, 'NFKD'), '[̀-ͯ]', '')"/> </xsl:function> Thanks all, Mark
|
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
|