Skip to Content
avatar image
Former Member

XSLT_beginner

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    May 17, 2007 at 08:09 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 17, 2007 at 09:27 AM

    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,

    Add comment
    10|10000 characters needed characters exceeded