cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT 1.0 current date

Former Member
0 Kudos

Hi,

I had searched on SDN already and tried few codes without success.

If somebody had already worked on current date function in XSLT mapping version 1.0, please share it.

Thanks in advance,

Venkat.

PS: links I already referred.

http://www.w3.org/TR/xpath-functions/#func-current-dateTime

Accepted Solutions (1)

Accepted Solutions (1)

former_member854360
Active Contributor
0 Kudos

Hi,

XSLT 1.0 does not provide any standard way to get the current date/time. You can call an extension function to do it (depends on your processor), or you can pass it to the stylesheet as the value of a parameter.

current-date() and current-time(). For XSLT 1 you'll have to use the dates-and-times EXSLT extension package. Here's a usage example for XSLT 1:

<xsl:stylesheet xmlns:ex="http://exslt.org/dates-and-times" extension-element-prefixes="ex">

<xsl:value-of select="ex:date-time()"/>

</xsl:stylesheet>

Refer this for

http://www.exslt.org/date/index.html

Answers (2)

Answers (2)

Former Member
0 Kudos

As others suggested, you need to build a workaround using java extention to XSLT or parameterized XSLT mapping.

Otherwise, you need to add one more message mapping (graphical) with target same as source structure and perform all date/time validations there and call it before xlst map in interface mapping (But this adds one more mapping step and consumes system resource and processing time).

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>If somebody had already worked on current date function in XSLT mapping version 1.0, please share it.

XSLT 1.0 does not support current date function. You need to do workaround to achieve this. Not using this version.