<xsl:stylesheet version="1.0"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="format-date.xslt"/>
<xsl:template match="/">
<xsl:call-template name="date:format-date">
<xsl:with-param name="date-time" select="'1997-07-16'" />
<xsl:with-param name="pattern" select="'MMM DD yyyy'" />
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:str="http://exslt.org/strings"
xmlns:func="http://exslt.org/functions"
extension-element-prefixes="date str func"
> - Modified the tag with the extra parameters
<xsl:import href="str.padding.function.xsl" />
- I did not find the code for this xsl
<date:months>
...
</date:months>
<date:days>
...
</date:days>
<func:function name="date:format-date">
...
</func:function>
<func:function name="date:_format-date">
...
</func:function>
<func:function name="date:_week-in-year">
...
</func:function>
<xsl:call-template name="date:format-date">
<xsl:with-param name="date-time" select="myVariable" />
<xsl:with-param name="pattern" select="'MMM DD yyyy'" />
</xsl:call-template>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:str="http://exslt.org/strings"
extension-element-prefixes="date str">
<date:months>
...
</date:months>
<date:days>
...
</date:days>
<xsl:template name="date:format-date">
...
</xsl:template>
<xsl:template name="date:_format-date">
...
</xsl:template>
<xsl:template name="date:_week-in-year">
...
</xsl:template>
<xsl:stylesheet version="1.0"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="parse-date.xslt" />
<xsl:import href="format-date.xslt"/>
<xsl:output method="text" />
<xsl:param name="date" select="'2/28/2009'" />
<xsl:variable name="formattedDate">
<xsl:call-template name="date:parse-date">
<xsl:with-param name="date-time" select="$date" />
<xsl:with-param name="format" select="'M/d/y'" />
</xsl:call-template>
</xsl:variable>
<xsl:template match="/">
<xsl:text>
</xsl:text>
<xsl:value-of select="$date"/>
<xsl:text>
</xsl:text>
<xsl:value-of select="$formattedDate"/>
<xsl:text>
</xsl:text>
<xsl:call-template name="date:format-date">
<xsl:with-param name="date-time" select="$formattedDate" />
<xsl:with-param name="pattern" select="'MMM dd yyyy'" />
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>
<xsl:stylesheet version="1.0"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="parse-date.xslt" />
<xsl:import href="format-date.xslt"/>
<xsl:output method="text" />
<xsl:param name="date" select="'16-09-1976'" />
<xsl:variable name="isoDate">
<xsl:call-template name="date:parse-date">
<xsl:with-param name="date-time" select="$date" />
<xsl:with-param name="format" select="'d-MM-yyyy'" />
</xsl:call-template>
</xsl:variable>
<xsl:template match="/">
<xsl:text>input date: </xsl:text>
<xsl:value-of select="$date"/>
<xsl:text>
iso date: </xsl:text>
<xsl:value-of select="$isoDate"/>
<xsl:variable name="full-date">
<xsl:call-template name="date:format-date">
<xsl:with-param name="date-time" select="$isoDate" />
<xsl:with-param name="pattern" select="'dd MMMM yyyy'" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="day-of-year">
<xsl:call-template name="date:format-date">
<xsl:with-param name="date-time" select="$isoDate" />
<xsl:with-param name="pattern" select="'D'" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="week-of-year">
<xsl:call-template name="date:format-date">
<xsl:with-param name="date-time" select="$isoDate" />
<xsl:with-param name="pattern" select="'w'" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="year">
<xsl:call-template name="date:format-date">
<xsl:with-param name="date-time" select="$isoDate" />
<xsl:with-param name="pattern" select="'yyyy'" />
</xsl:call-template>
</xsl:variable>
<xsl:text>
full date: </xsl:text>
<xsl:value-of select="$full-date" />
<xsl:text> (is the </xsl:text>
<xsl:value-of select="$day-of-year" />
<xsl:text>th day and the </xsl:text>
<xsl:value-of select="$week-of-year" />
<xsl:text>th week of </xsl:text>
<xsl:value-of select="$year" />
<xsl:text>)</xsl:text>
</xsl:template>
</xsl:stylesheet>