XML : Convert xml date output yyyy-mm-ddThh:mm:ss to dd-mmm-yy using xsl1.0

My XML outputs a due date in the format of yyyy-mm-ddThh:mm:ss.

I would like it to show dd-mmm-yy instead, for example 20-Nov-15.

This is what I am working on in my XSL1.0 stylesheet (simplified):

  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="urn:user-scripts" xmlns:aras="http://www.aras-corp.com">  <xsl:output method="html" omit-xml-declaration="yes" standalone="yes" indent="yes"/>  <xsl:template match="/">    <html>  <body>      <table>          <tr>              <td>Action Item No</td>              <td>Need Date</td>          </tr>            <xsl:for-each select="//Item">              <tr>                  <td>                      <xsl:value-of select="action_id"/>                  </td>                  <td>                      <xsl:value-of select="due_date"/>                  </td>              </tr>          </xsl:for-each>      </table>  </body>  </html>  </xsl:template>  </xsl:stylesheet>    

Please advise how I can accomplish the new date format dd-mmm-yy in my XSL stylesheet, and exactly where to put in the code (it'd be great if you can paste the whole structure back to me so I can comprehend... total rookie here!)

Thank you!

No comments:

Post a Comment