Hello,
Is there a better way of doing:
I.e. in an procedural language I would do:
if(a)
{
i = someval; j = someval; k = someval;
}
else
{
i = someotherval; j = someotherval; k = someotherval;
}
In XSLT it seems to be a case of put the conditional inside every single variable assignment - is there a better way?
Thanks,
Dave
Is there a better way of doing:
Code:
<xsl:variable name="frlink">
<xsl:choose>
<xsl:when test="@isFriend = '0'"><xsl:value-of select="concat('friends.php?add=', @uid)"/></xsl:when>
<xsl:otherwise> <xsl:value-of select="concat('friends.php?add=', @uid)"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="frstr">
<xsl:choose>
<xsl:when test="@isFriend = '0'"><xsl:value-of select="'FR_ADD_TO_FRIENDS'"/></xsl:when>
<xsl:otherwise> <xsl:value-of select="'FR_REMOVE_FRIEND'"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
if(a)
{
i = someval; j = someval; k = someval;
}
else
{
i = someotherval; j = someotherval; k = someotherval;
}
In XSLT it seems to be a case of put the conditional inside every single variable assignment - is there a better way?
Thanks,
Dave
Comment