xsl-list
[Top] [All Lists]

alphabetic set of xsl:result-document

2005-08-22 05:58:53
I know I'm just being silly and this should be obvious to me.  Maybe
it is because it is Monday.

Ok, assuming I have an XML input file with at various levels lots of
words marked up <w>as</w> <w>such</w>, and I'm producing an
alphabetically sorted index of them.

Currently this is being done with the following (highly abbreviated
and simplified):

<!-- setup key for words -->
<xsl:key name="word" match="w" use="lower-case(.)" /> 
[...]
<!-- Iniside root template match  group by word then sort -->
<xsl:for-each-group select="//div[(_at_)type='psalm']//w" 
group-by="lower-case(.)">
     <xsl:sort select="lower-case(.)" />
[...]
<!-- Output each word (and associated references, etc.) inside an
xsl:for-each -->
        <xsl:for-each select="key('word', lower-case(.)">
[...]
etc.

What I want to do is group each of the output words and create a
separate file for each letter of the alphabet matched.  I've been
assuming that I put the xsl:result-document in an xsl:for-each inside
the xsl:for-each-group above, but my attempts so far have failed.  So
I guess my questions are how do I say "for-each unique starting-letter
of the words create a result-document only including words starting
with that letter"? And am I right that this should be inside the
xsl:for-each-group ?

Needing more sleep,

-James 

-- 
James Cummings, Cummings dot James at GMail 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>