title: Getting compile error while using format-date() method in XSLT
body: <p>I am trying to convert a XML to CSV using XSLT with version 2.0. But I get a compile error while using format-date method in XSLT. 
  Following is the error: </p>
  
  <blockquote>
    <p>Error checking type of the expression 'funcall(format-date, [variable-ref(dt/string), literal-expr([D01]/[M01]/[Y0001])])'.<br>
    FATAL ERROR:  'Could not compile stylesheet'. </p>
  </blockquote>
  
  <p>XSLT code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"       xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:func="http://exslt.org/functions" xmlns:date="http://exslt.org/dates-and-times"
              extension-element-prefixes="date" date:doc="http://www.exslt.org/date"&gt;
  
  &lt;xsl:output method="text"/&gt;
  
  &lt;xsl:template match="/"&gt;    
  &lt;xsl:variable name="dt" select="'2013-04-04'"/&gt;
  &lt;xsl:value-of select="format-date($dt, '[D01]/[M01]/[Y0001]')" /&gt;  
  &lt;xsl:value-of select="format-date(current-date(), '[D01]/[M01]/[Y0001]')" /&gt;               
  
  &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>