Link to home
Start Free TrialLog in
Avatar of singhch
singhch

asked on

How to get the current date in XSLT?

Hi there,

I am trying to get the current date in my XSLT but unavailable to achieve it.

The following is an example of my XSLT using the EXSLT but it is not working.  It is complaining that it doesnt recognise the template.

Any clues anyone?  thanks

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:date="http://exslt.org/dates and times" extension-element-prefixes="date">
      <xsl:import href="date.msxsl.xsl"/>
      <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
      <xsl:template match="/parent">
            <parent>
                  <xsl:apply-templates/>
            </parent>
      </xsl:template>
      <xsl:template match="children">
            <ChildFound>
                  <xsl:call-template name="date:date-time()"/>      
            </ChildFound>            
      </xsl:template>
</xsl:stylesheet>
ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
note that I changed the matches in the templates, I did that for testing, so you need to chnage them back to original
Forced accept.

Computer101
EE Admin