Re: [xsl] Can this hard-coded template be generalized?

Subject: Re: [xsl] Can this hard-coded template be generalized?
From: "Mark" <mark@xxxxxxxxxxxx>
Date: Sun, 2 Oct 2011 15:40:37 -0700
Hi Ken,
I'll be looking for your book/DVD announcement.

Earlier, you mentioned the unnecessary grouping in my code. Since this is a pattern I often use, I'd like to know if there is a simpler way. Here is the reason I did the grouping :

This time, the goal is to write both buttons (complex=105 and complex=107) as before, but now to the same document. Also, they need to be numbered sequentially starting with '1'. (The Czech language button simply reflects localization).

[By the way, the file names change rapidly from format to format. While they won't be needed later, right now the string disassembly prevents my making even more typos.]

<xsl:if test="cps:page-type($file-type) eq 'souvenir-sheet'">
<xsl:for-each-group select="../Stamp/Formats" group-by="@complex">
<xsl:variable name="file-name" select="concat(substring-after($page-name-stem,'aip/'), @complex, 's.htm')"/>
<a lang="en" class="button" href="{$file-name}">
<xsl:text>Se-tenant </xsl:text>
<xsl:value-of select="position()"/>
<a lang="cz" class="button" href="{$file-name}">
<xsl:value-of select="position()"/>
<xsl:text>. Spojky</xsl:text>

Current Thread