on 03-27-2006 11:37 AM
Hi,
I am doing a xslt mapping, i need to mark a field with the server Time of xi server, any lights on this?
Regards,
Anirban.
Hi Anirban,
Try this:
<Date_Time>
<date>
<xsl:value-of select="current-date()"/>
</date>
<time>
<xsl:value-of select="current-time()"/>
</time>
</Date_Time>
Use the substring function to get the format which you require.
Regards,
Anish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
the graphical mapping function "currentDate" also gets hours, minutes and seconds
for the syntax use "yyyy/MM/dd hh:mm:ss" and you see
i am on SP15
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The below code could be of some use...
<b><?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:myjava="java.util.Calendar">
<xsl:template>
<date>
<xsl:value-of select="myjava:HOUR_OF_DAY"/><xsl:value-of select="myjava:MINUTE"/><xsl:value-of select="myjava:SECOND"/>
</date>
</xsl:template>
</xsl:stylesheet></b>
Regards,
KNS Kumar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anirban,
i think u dont have a fucntion to get the current time of the server directly in XSLT.you need to write a user defined function in java to get the current time and call that java function in XSLT.
u can try this code for getting time
SimpleDateFormat formatter = new SimpleDateFormat("hh:mm:ss a z");
Date now = new Date();
String nowAsString = formatter.format(now);
if u run it in ur XI server u will get the server time.
for calling java functions in XSLT chk out this link
regards
jithesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anirban,
you can use Java functions inside your xslt mapping. The function should be static.
Try to use this weblog. This will fulfill your requirement.
/people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
Regards
Vishal Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try calling this function : <b>date:date-time()</b>. It will return <i>Returns the current date and time</i>
For more info click here <a href="http://www.w3.org/TR/xpath-functions/#func-current-dateTime">here</a>
Regards
Suraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anirban,
You can use user defined function in Java and use the standard fuction available in java to capture the server time and date.
Thanks,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anirban,
Yo can write a user defined function to get the server time.
Regards
vijaya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.