when to use xsl:if and when to use xsl:choose/xsl:when in XSLT
I know this may seem like a dumb/newbie question, but I'm fairly new to
XSLT (though I'm starting to come around to it and see it's capabilities).
When is it appropriate to use xsl:if and when is it appropriate to use
xsl:choose/xsl:when?
I have been using choose/when/otherwise when I want to have an "else"
option. Is this correct?
For instance I have some places where I'm doing:
<xsl:choose>
<xsl:when test="count(entry) != 0">
put positive outcome here
</xsl:when>
<xsl:otherwise>
put something else here
</xsl:otherwise>
</xsl:choose>
would xsl:if be better?
Thanks for the input.
No comments:
Post a Comment