Subject: Re: [xsl] basename string sort and group From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Sat, 03 Sep 2011 14:10:28 +0200 |
Given input such as <fonts> <entry href="/apps/jdk/lib/fonts/LucidaTypewriterRegular.ttf">Lucida</entry> <entry href="/apps/jdk/lib/fonts/LucidaTypewriterBold.ttf">Lucida</entry> <entry href="/apps/jdk/lib/oblique-fonts/LucidaSansDemiOblique.ttf">Lucida</entry> </fonts>
I want to sort and group by directory, for an output such as
<fonts> <dir href="/apps/jdk/lib/fonts"> <entry href="LucidaTypewriterRegular.ttf">Lucida</entry> <entry href="LucidaTypewriterBold.ttf">Lucida</entry> </dir> <dir href="/apps/jdk/lib/oblique-fonts"> <entry href="LucidaSansDemiOblique.ttf">Lucida</entry> </dir>
etc.
I.e. Isolate the directories, then group all entries within that directory.
<xsl:template match="entry"> <entry href="{tokenize(@href, '/')[last()]}"> <xsl:value-of select="."/> </entry> </xsl:template>
Martin Honnen --- MVP Data Platform Development http://msmvps.com/blogs/martin_honnen/
Current Thread |
---|
<- Previous | Index | Next -> |
---|---|---|
[xsl] basename string sort and grou, davep | Thread | Re: [xsl] basename string sort and , davep |
[xsl] basename string sort and grou, davep | Date | Re: [xsl] stylesheet organisation, G. Ken Holman |
Month |