title: Transformation of text file into an xml using datapower
body: <p>I want to transfer a non-xml text file delimited by '|' characters into an xml using Datapower.</p>
  
  <pre><code>Following is file  (sample1)
  </code></pre>
  
  <p>10|20003|24/23/25|23890</p>
  
  <p>Now i have to break this into the following XML</p>
  
  <pre><code> &lt;ResponseType&gt;
          &lt;ResCode&gt;10&lt;/ResCode&gt;
          &lt;Id&gt;20003&lt;/Id&gt;
           &lt;SoftCode&gt;24/23/25&lt;/SoftCode&gt;
          &lt;StatusCode&gt;23890&lt;/StatusCode&gt;
    &lt;/ResponseType&gt;
  </code></pre>
  
  <p>What I did was following--</p>
  
  <p>1>Create a Transform action in the service that will be receiving non-XML requests.</p>
  
  <p>2>Select "Use XSLT specified in this action on a non-XML message" to specify that this is a Binary Transform.   </p>
  
  <p>3>Upload the following stylesheet as the Processing Control File.</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
         &lt;xsl:stylesheet
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:dp="http://www.datapower.com/extensions"
      version="1.0"&gt;
  
      &lt;dp:input-mapping href="sample1.ffd" type="ffd"/&gt;
  
  
      &lt;xsl:output method="xml"/&gt;
  
      &lt;xsl:template match="/"&gt;
      &lt;xsl:copy-of select="ResponseType"/&gt;
      &lt;xsl:call-template name="str:tokenize"&gt;
       &lt;xsl:with-param name="string" select="string" /&gt;
  
      &lt;/xsl:call-template&gt;
      &lt;/xsl:template&gt;
  
  
      &lt;xsl:template name="str:tokenize"&gt;
  &lt;xsl:with-param name="string" select=""&gt;
  
      str:tokenize('string', '|')
  &lt;/xsl:with param&gt;
  &lt;/xsl:template&gt;
      &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>and here is my sample1.ffd(which I have uploaded in my local://  directory in Datapower</p>
  
  <pre><code>&lt;File name="ResponseType"&gt;
  &lt;!-- capture all data into this tag --&gt;
  &lt;Field name="ResCode/Id/SoftCode/StatusCode" /&gt;
  &lt;/File&gt; 
  </code></pre>
  
  <p>But I am not getting desired output , I think my xslt is quite wrong
  What can I do do  to get desired output?</p>