Your code looks fine - Are you asking how to call it?
If so,
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:call-template name="showDate">
<xsl:with-param name="date" select="summary/date"/>
<xsl:with-param name="countryCode" select="summary/countryCode"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="showDate">
<xsl:param name="date"/>
<xsl:param name="countryCode"/>
<xsl:choose>
<xsl:when test="$countryCode = 'US'">
<xsl:value-of select="concat($date/month, '/', $date/day, '/', $date/year, ' ', $date/time)"/>
</xsl:when>
<xsl:when test="$countryCode = 'POL'">
<xsl:value-of select="concat($date/day, '/', $date/month, '/', $date/year, ' ', $date/time)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($date/year, '/', $date/month, '/', $date/day, ' ', $date/time)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Regards
Bryan
|