Not too good with all the constructs yet, so I have a small issue with the following piece of XSLT...
Code:
<xsl:if test="count(references/reference) > 0">
<td class="thumb" rowspan="2">
<a href="{@full}" target="blank">
<img class="thumb" src="{@thumb}" alt="{languages/this/string[@name='thumbalt']}" />
</a>
</td>
</xsl:if>
<xsl:if test="count(references/reference) = 0">
<td class="thumb" rowspan="1">
<a href="{@full}" target="blank">
<img class="thumb" src="{@thumb}" alt="{languages/this/string[@name='thumbalt']}" />
</a>
</td>
</xsl:if>
Clearly, it is not pretty, since there is a lot of redundant HTML. The only difference is the value of the rowspan attribute. I cannot find a way to get the same result as the above code with less redundant code.
Can I use variables somehow? Tried but could not override already assigned variables. I would have liked to be able to do something like this instead...
Code:
<xsl:variable name="spaning" select="1" />
<xsl:if test="count(references/reference) > 0">
<xsl:variable name="spaning" select="2" />
</xsl:if>
<td class="thumb" rowspan="{$spanning}">
<a href="{@full}" target="blank">
<img class="thumb" src="{@thumb}" alt="{languages/this/string[@name='thumbalt']}" />
</a>
</td>
Is there som construct I should learn about to solve problems like this?
Thanks, Jacob.