on 04-14-2018 3:36 AM
Hi Integration Experts,
I need to convert a date in this format
2018-04-13T12:42:42.224416+00:00 to ddMMyyHHmmss based on the substrings of the original date value by using XSLT mapping. How I can achieve this?
Input:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<order>
<id>123</id>
<create_date>2018-01-01T12:00:00.224416+00:00</create_date>
</order>
</root>
output:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<order>
<id>123</id>
<create_date>20180101120000</create_date>
</order>
</root>
Have a nice weekend!
Regards,
Jeremy
Hello Jeremy,
Below will convert the same.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="create_date">
<create_date>
<xsl:value-of select="format-dateTime(.,'[Y0001][M01][D01][H01][m01][s01]')" />
</create_date>
</xsl:template>
</xsl:stylesheet>
Regards,
Sriprasad Shivaram Bhat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sriprasad Shivaram Bhat,
Thanks this works!
Regards,
Jeremy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.