Skip to Content
avatar image
Former Member

XSLT 1.0 current date

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

error-in-current-date-in-xslt-mapping

xslt-mapping-getting-current-date-in-xslt-version

current-date-in-xslt-mapping

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Jul 29, 2011 at 08:01 AM

    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:

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 29, 2011 at 02:24 PM

    >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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 29, 2011 at 04:54 PM

    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).

    Add comment
    10|10000 characters needed characters exceeded