Today I needed to do some dateTime formatting in XSLT 1.0 and I found that it was not an easy task. After digging in Google I found really nice dateTime functions but all of them were available in XSLT 2.0 .Of course I am using MSXML 6.0 coming with .NET and that’s the last version. Microsoft have promised to release support for XSLT 2.0 in 2007 but it is still not available. The .NET 3.5 is out for a few years now although the XSLT 2.0 is w3 standard since 2007.So we just have to wait !?
After discovering the reality i searched for alternative ways and I came across EXSLT. There I found what I needed in various implementations:
I just downloaded the template of the function(xsl file) and included it in my XSLT files as shown on the page and everything worked perfect. It is also possible to import it as a xslt or javascript function. The whole code implementation is put in a file. Another cool thing is the output of the date:difference function which looks like
P1Y2M3DT10H30M for a duration of 1 year, 2 months, 3 days, 10 hours, and 30 minutes. This is also w3 documented and works great.
I have found some advices from Microsoft how to use EXSLT in .NET:
EXSLT: Enhancing the Power of XSLT
It seems to me that they are also aware of the missing functionality in XSLT processor. You can also check the XML/XSL Portal .

