0

I'm having the date with numeric format, I need to change into the string format

Input XML(Month/Day/Year):

<Field>03/01/2021</Field>

XSLT I have tried:

    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xsl:output method="text"/>
  <xsl:strip-space elements="*"/>
  <xsl:variable name="in" select="Field"/>
  <xsl:template match="/">
    <xsl:variable name="date" select="xs:date(concat(
      substring($in,/),'-',
      substring($in,/),'-',
      substring($in,/)))"/>
    <xsl:value-of select="format-date($date,'[MNn] [D], [Y]')"/>
  </xsl:template>
</xsl:stylesheet>

Expected Output is:

March 1, 2021
User501
  • 319
  • 1
  • 14

0 Answers0