Subject: Re: for-each-group and result-document splitting to less files.
From: "James Cummings" <cummings.james@xxxxxxxxx>
Date: Mon, 8 Sep 2008 13:02:55 +0100
|
On Fri, Sep 5, 2008 at 14:19, Michael Kay <mike@xxxxxxxxxxxx> wrote:
>> I want to break it into 5 files for punctuation&numbers, a-f,
>> g-l, m-r, and s-z.
>
> Part of the solution might be to use a grouping key created using
>
> translate(., 'abcdefghijklmnopqrstuvwxyz', 'aaaaaaggggggmmmmmmssssssss')
>
Having had a chance to play with this on the outer xsl:for-each-group I did:
<xsl:for-each-group select="$persNamesWithoutKey"
group-by="translate(substring(normalize-space(lower-case(.)),1,1),'abcdefghijklmnopqrstuvwxyz012345678[,+(.><&&amp;
', 'aaaaaaggggggmmmmmmssssssss999999999---------') ">
and with some minor cosmetic changes through the rest that did it
absolutely perfectly for my needs.
I post this just for posterity (i.e. anyone else searching for a
similar answer and in several months when I've forgotten how/why I did
something like this!) ;-)
Many thanks,
-James
|