HI friends,
need help in XSLT 1.0 to get the current system date
Any help is highly appreciated.
I have done the below that I read from other posts but without any luck.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
<xsl:template name="today"
xmlns:cal="java:java.util.GregorianCalendar">
<xsl:variable name="rightNow" select="cal:getInstance()" />
<!-- The Calendar class uses zero-based months;
i.e. January is month 0, February is month 1, and
so on. We have to add one to get the customary month
number. -->
<xsl:variable name="month" select="cal:get($rightNow, 2) + 1" />
<xsl:variable name="day" select="cal:get($rightNow, 5)" />
<xsl:variable name="year" select="cal:get($rightNow, 1)" />
<xsl:value-of
select="$year" />-<xsl:value-of
select="$month" />-<xsl:value-of
select="$day" />
<xsl:element name="CurrDate">
<xsl:attribute name="TodayDate">
<xsl:value-of select="$rightNow"/>
</xsl:attribute>
</xsl:element>
</xsl:template>
<xsl:template match="today">
<xsl:element name="CurrDate">
<xsl:attribute name="TodayDate">
<xsl:value-of select="rightNow"/>
</xsl:attribute>
</xsl:element>
</xsl:template>
</xsl:stylesheet>