title: XSLT split string by charlength and call function for each substring
body: <p>For example if you have a string that does not have a fixed length, but is always in increments of 2, how should I break up the string into multiple parts and call a template for each of the substring, as each of them correspond to a different text.</p>
  
  <pre><code>&lt;root&gt;
  &lt;Data&gt;
  &lt;ErrorNumber&gt;12345678&lt;/ErrorNumber&gt;
  &lt;/Data&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>For the error codes suppose</p>
  
  <pre><code>12 = "Test 1"
  34 = "Test 2"
  56 = "Test 3"
  78 = "Test4"
  </code></pre>
  
  <p>So that function should call this function and get the output</p>
  
  <pre><code>&lt;xsl:template name="GetErrorCode"&gt;
  &lt;xsl: param name = "ErrorCode"/&gt;
  &lt;xsl: if test = "$ErrorCode = '12'"&gt;
  &lt;xsl:text&gt; Test 1 &lt;/xsl:test&gt;
  &lt;/xsl:if&gt;
  &lt;/xsl template&gt;
  </code></pre>
  
  <p>So basically if I pass 12345678 as param I would get </p>
  
  <pre><code>Test 1
  Test 2
  Test 3
  Test 4
  </code></pre>
  
  <p>As Output</p>