cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT_beginner

Former Member
0 Kudos

Hi,

In XSLT mapping If my source has a value A or U or I then in the target A must be set to I, I to u.

How to achive this.

Can you Please send me a sample code for diplaying date and time of the system.

to srinivas5780@gmail.com.I tried using current-datetime() but do not know how and where to insert this function to display the same.

Thanks,

Phani

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

For point 1

You can use If with else, equls & Constant function & acheive it.

For point 2.

Calendar cal = new GregorianCalendar();

SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddhhmmss");

GregorianCalendar date = new GregorianCalendar();

String dateStr = formatter.format(date.getTime());

use above mentiond code in User defined function.

Regards

Sushil

Former Member
0 Kudos

Is this Java script?how to sert the same in XSLT

Former Member
0 Kudos

You can create a user defined function (UDF) & can use the coding there.

Regards

Sushil

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

Please use the sample code below to get Date and Time..

<xsl:stylesheet

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

version="2.0">

<xsl:output method="xml"

indent="yes"

omit-xml-declaration="yes"/>

<xsl:template match="/">

<DATTIME>

<xsl:value-of select="current-dateTime()"/>

</DATTIME>

<DATE>

<xsl:value-of select="current-date()"/>

</DATE>

<TIME>

<xsl:value-of select="current-time()"/>

</TIME>

</xsl:template>

</xsl:stylesheet>

Regards,