on 08-04-2015 2:31 PM
Hi SDNites,
I am trying to get the current date in XSLT 1.0. Please let me know how should I do it. There are certain blogs which mentions that I have to write JAVA code and import it into XSLT. If this is the way can you please suggest how should I import JAVA code into XSLT.
Also there are certain blogs which says that XSLT 2.0 has methods which does that. Can you please let me know how do I move from version 1.0 to 2.0. I am using NWDS to write my XSL transformation logic and it has automatically used version 1.0.
<xsl:stylesheet version="1.0"
Regards,
Abhi
Abhishek,
Use XSLT 2.0 in PI.
FYI, you can set new processor in NWDS "Processor Tab".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhishek,
You can use multiple mapping in your ESR - Operation Mapping to achieve this requirement.
In your 1st Message Mapping, use the Sender Message Type as your Source as well as Target. Then populate current date from UDF function 'currentDate' and pass it to a non used field of Sender structure.
In the 2nd Mapping which is XSLT, use this field value to populate actual Target field of the Receiver structure.
Regards,
Nabendu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could use something like this (months in GregorianCalendar are 0 based)
This template calls Java class GregorianCalendar
<xsl:template name="today" xmlns:cal="java:java.util.GregorianCalendar">
<xsl:variable name="rightNow" select="cal:getInstance()" />
<xsl:variable name="month" select="cal:get($rightNow, 2) + 1" />
<xsl:variable name="day" select="cal:get($rightNow, 5)" />
<xsl:variable name="year" select="cal:get($rightNow, 1)" />
<xsl:value-of
select="$year" />-<xsl:value-of select="$month" />-<xsl:value-of select="$day" />
</xsl:template>
br
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.