title: Using XSLT to transform date format from yyyy-mm-dd to dd-mm-yy
body: <p>I am reading an XML document in which there is a date tag as shown below.</p>
  
  <pre><code>&lt;uabDate&gt;2014-07-23&lt;/uabDate&gt;
  </code></pre>
  
  <p>Now I am reading this XML from XSL and trying to parse it, but I want to translate that date value into a format like 23-07-14.</p>
  
  <p>What I have tried is given below.</p>
  
  <p>Here I am calling the template that will store uabDate in a variable <code>businessDate</code> and then calling the template </p>
  
  <pre><code>&lt;xsl:call-template name="convertDateToDDMMYYYY_template"&gt;
    &lt;xsl:with-param name="b1" 
                    select="$s2Date/uabDate"/&gt;
  &lt;/xsl:call-template&gt;
  </code></pre>
  
  <p>and here is the definition of the named template:</p>
  
  <pre><code>&lt;xsl:template name="convertDateToDDMMYYYY_template"&gt;
    &lt;xsl:param name="b1"/&gt;
    &lt;xsl:variable name="DateVar"&gt;
      &lt;xsl:value-of select="concat(
        substring(./b1,1,4),
        '-',
        substring(./b1,6,2),
        '-',
        substring(./b1,9,2))"/&gt;
    &lt;/xsl:variable&gt;
  
  &lt;/xsl:template&gt;
  </code></pre>