xsl-list
[Top] [All Lists]

Re: [xsl] for-each-group group-by

2012-04-04 16:22:23
To group by the first alpha character in ALL cases (not just those listed), use

group-by="replace(paperTitle, '^([P{L}]).*$', '$1')"

(not tested)

Michael Kay
Saxonica

On 04/04/2012 22:03, Craig Sampson wrote:
Hello,
   I am creating an index of paper titles using xsl:for-each-group to select 
and group by the titles of the papers alphabetically using the first character 
of the title.

Eg:
   <xsl:for-each-group select="//section" 
group-by="upper-case(substring(normalize-space(paperTitle),1,1))">
     <xsl:sort select="current-grouping-key()"/>
    . . .

   Some of the paper titles start with double left hand quotes. Others start 
with a numeral. In those cases I want the group-by to use the first alpha 
character in the title string. I could do this if regular expressions were 
allowed in the group-by attribute, but they're not.

   Can anyone suggest how to make this work?

Thanks,
   Craig




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>