alphabetic set of xsl:result-document
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[@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
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