Hello,
Checked it out but the code, but didnt work, pretty sure Im missing something. Please see below (see a Ja// instead).
<xsl:template match="/">
<xsl:call-template name="showDateDropdown" />
</xsl:template>
<xsl:template name="showDateDropdown">
<xsl:call-template name="format-date">
<xsl:with-param name="date" select="date" />
<xsl:with-param name="format" select="1" />
</xsl:call-template>
<form name='drop2'>
<select style="width:180px; background:#ccc; color:#000; font-weight:bold; font-size:10px;">
<xsl:attribute name="onChange">
<xsl:text>this.form.submit
</xsl:attribute>
<option value='0'>Select Date</option>
<xsl:for-each select="//item[generate-id
<option value='{date}'>
<xsl:value-of select="date"/>
</option>
</xsl:for-each>
</select>
</form>
</xsl:template>
<!-- 1/8/04 01.08.04 Jan 8 2004 -->
<xsl:template name="format-date">
<xsl:param name="date" />
<xsl:param name="format" select="0" />
<xsl:variable name="day" select="substring-before(s
<xsl:variable name="monthName" select="substring-before(s
<xsl:variable name="year" select="substring-before(s
<xsl:variable name="month" select="substring(substrin
<xsl:variable name="day2" select="concat(translate(s
<xsl:variable name="month2" select="concat(translate(s
<xsl:choose>
<xsl:when test="$format = 1">
<xsl:value-of select="concat($month2, '/', $day2, '/', substring($year, 3))" />
</xsl:when>
<xsl:when test="$format = 2">
<xsl:value-of select="concat($month, '.', $day, '.', substring($year, 3))" />
</xsl:when>
<xsl:when test="$format = 3">
<xsl:value-of select="concat($monthName,
</xsl:when>
<xsl:when test="$format = 4">
<xsl:value-of select="concat($day2, '/', $month2, '/', substring($year, 3))" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$date" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Main Topics
Browse All Topics





by: naik_sanketPosted on 2007-08-19 at 20:19:50ID: 19728110
http://www.experts-exchang e.com/Web/ Web_Langua ges/XML/ Q_ 20844888.h tml
You might like to have a look at this previous post. Hope it solves your problem. Do let know if your requirement is someting else.
Regards,
Sanket