title: xquery substring and then concat
body: <p>I am trying to use <code>substring</code> and <code>concat</code> functions in an XQuery statement together.</p>
  
  <p>Here is what I have:</p>
  
  <pre><code>fn:concat(fn:substring({data($x/DueDate)},1,4),fn:substring({data($x/DueDate)},6,2),fn:substring({data($x/(DueDate))},9,2))
  </code></pre>
  
  <p>The value for DueDate in my xml is: <code>2013-06-27</code>.</p>
  
  <p>I expected the above function to return: <code>20130704</code>.</p>
  
  <p>Instead, this is what I get:</p>
  
  <pre><code>fn:concat(fn:substring(2013-06-27,1,4),fn:substring(2013-06-27,6,2),fn:substring(2013-06-27,9,2))
  </code></pre>
  
  <p>I am confused as to why!</p>