cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Current date in xslt mapping

Former Member
0 Likes
4,082

Hi,

I've tried to get the current date in my xslt mapping.

I've used the following xslt coding:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:date="http://exslt.org/dates-and-times" extension-element-prefixes="date">

<xsl:template match="/">

<xsl:variable name="now" select="current-date()"/>

</xsl:template>

</xsl:stylesheet>

In stylus studio everything is OK and i retrieve the current date.

When i import the xslt in the mapping tool and test the mapping i get the following error:

javax.xml.transform.TransformerException: com.sap.engine.lib.xml.util.NestedException: Function with name 'current-date' not found in context library. at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:251)

While directly using the current date functionality within the message mapping everything is OK too.

Does anyone know which date-functionality is used within the message mapping within the Integration Builder and/or wich mapping to be used in xslt for a working scenario?

Thnx in advance!

View Entire Topic
Former Member
0 Likes

Hi,

<xsl:template name="currentTime" 
              xmlns:date="java:java.util.Date">
  <xsl:value-of select="date:new()"/>
</xsl:template>

Go through this document

http://cafeconleche.org/books/xmljava/chapters/ch17s03.html

This link is also having the same problem please check

Please reward points

Thanks

Vikranth