Going back to the basics, I would like to know in detail the significance of the below code over the latter .. or vice versa ..
Code sample1:
<xsl:template match="Gender">
<xsl:copy>
<xsl:if test=".='M'">
<xsl:text>Male</xsl:text>
</xsl:if>
<xsl:if test=".='F'">
</xsl:text>Female</xsl:text>
</xsl:if>
</xsl:copy>
</xsl:template>
Code sample2:
<xsl:template match="Gender[.='M']">
<xsl:copy>
<xsl:text>Male</xsl:text>
</xsl:copy>
</xsl:template>
<xsl:template match="Gender[.='F']">
<xsl:copy>
<xsl:text>Female</xsl:text>
</xsl:copy>
</xsl:template>
I could use <xsl:choose/>
instead in code1, that's not the point .. I would like to discuss on how wise is to use different templates with matching conditions over usage of if and else conditions .. considering the Performance, readability and maintenance and many more factors?