on 05-20-2013 10:44 AM
Hi Folks,
I got a requirement to have the current timestamp in XSLT mapping.
The Code i have developed is working fine at the Altova XML SPY but it is failing when i test in PI
<Time>
<xsl:variable name="time">
<xsl:value-of select="current-time()"/>
</xsl:variable>
<xsl:value-of select="concat(substring($time,1,2),substring($time,4,2),substring($time,7,2))"/>
</Time>
I have provided the code above, could you please kindly mention the changes that help me to get the result in SAP PI.
The Error am getting in PI "current-time() not found in the context library"
Thanks & Regards,
Sekhar
Do something like this.. you might have to customize for the timestamp as per your need...
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:java="http://xml.apache.org/xslt/java"
exclude-result-prefixes="java">
<xsl:value-of select="java:format(java:java.text.SimpleDateFormat.new('yyyy.MM.dd'), java:java.util.Date.new())" />
</xsl:stylesheet>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shekar,
Why don't use a second mapping after the XSL mapping?. In a message mapping you can do easily and it will be easier to mantain and understand.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you can use the runtime constant $TimeSent, first declare it as parameter:
<xsl:param name="TimeSent" />
/Udo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
have you seen below thread :
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
in PI we cannot use xslt 2.0 so the data function does not work
more info:
http://scn.sap.com/thread/2006718
Regards,
Michal Krawczyk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.