![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Using XSL to reverse a date string [Thread Next] Re: Using XSL to reverse a date stringTo: NULL Date: 2/14/2007 2:06:00 PM
Amit wrote:
> I want to rearrange the date in the following xml file from 20070226
> to 26022007 using xsl,
> <date>20070226</date>
Look into the string functions
<http://www.w3.org/TR/xpath#section-String-Functions>
then you can do e.g.
<xsl:template match="date">
<xsl:copy>
<xsl:value-of select="concat(substring(., 7), substring(., 5, 2),
substring(., 1, 4))"/>
</xsl:copy>
</xsl:template>
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
