title: String Manipulation using XSLT
body: <p>I am using XSLT to create CSV file from XML file.</p>
  
  <p>currently my xml file looks like</p>
  
  <pre><code>&lt;VWSRecipeFile&gt;
  &lt;PDCScaling User="" Version="1.0" Description="PDCTesting" LastChange="41984.7673783102"&gt;
      &lt;Values&gt;
          &lt;Ch1_MLC_Application_GVLPDC_PDC_Body_Sca_GrossWeightTopFlash_Set Item="Upper flash_set" Unit="kg" Type="4" Hex="00000000" Value="0"/&gt;
          &lt;Ch1_MLC_Application_GVLPDC_PDC_Body_Sca_GrossWeightTopFlash_Act Item="Upper flash_act" Unit="kg" Type="4" Hex="00000000" Value="0"/&gt;
          &lt;Ch1_MLC_Application_GVLPDC_PDC_Body_Sca_GrossWeightTopFlash_TolUpp Item="Upper flash_max" Unit="kg" Type="4" Hex="00000000" Value="0"/&gt;            
      &lt;/Values&gt;
  &lt;/PDCScaling&gt;
  &lt;/VWSRecipeFile&gt;
  </code></pre>
  
  <p>And my xslt looks like </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;xsl:output method="text" indent="no"/&gt;
  
  &lt;xsl:template match="/VWSRecipeFile"&gt;
  
    &lt;xsl:for-each select="PDCScaling/Values/*"&gt;
      &lt;xsl:value-of select="concat(@Item,';')" /&gt;
    &lt;/xsl:for-each&gt;
  
    &lt;xsl:text&gt;&amp;#xA;&lt;/xsl:text&gt;
  
    &lt;xsl:for-each select="PDCScaling/Values/*"&gt;
      &lt;xsl:value-of select="concat(@Unit,';')" /&gt;
    &lt;/xsl:for-each&gt;
  
    &lt;xsl:text&gt;&amp;#xA;&lt;/xsl:text&gt;
  
    &lt;xsl:for-each select="PDCScaling/Values/*"&gt;
      &lt;xsl:value-of select="concat(@Value,';')" /&gt;
    &lt;/xsl:for-each&gt;
  
    &lt;xsl:text&gt;&amp;#xA;&lt;/xsl:text&gt;
  &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Now there is change in xml file and it looks like</p>
  
  <pre><code>&lt;VWSRecipeFile&gt;
  &lt;PDCScaling User="" Version="1.0" Description="PDCTesting" LastChange="41984.7673783102"&gt;
      &lt;Values&gt;
          &lt;Ch1_MLC_Application_GVLPDC_PDC_Body_Sca_GrossWeightTopFlash_Set Item="Upper flash_set_kg" Type="4" Hex="00000000" Value="0"/&gt;
          &lt;Ch1_MLC_Application_GVLPDC_PDC_Body_Sca_GrossWeightTopFlash_Act Item="Upper flash_act_kg" Type="4" Hex="00000000" Value="0"/&gt;
          &lt;Ch1_MLC_Application_GVLPDC_PDC_Body_Sca_GrossWeightTopFlash_TolUpp Item="Upper flash_max_kg" Type="4" Hex="00000000" Value="0"/&gt;           
      &lt;/Values&gt;
  &lt;/PDCScaling&gt;
  &lt;/VWSRecipeFile&gt;
  </code></pre>
  
  <p>What's changed is, in current file "Item" and "Unit" is merged and is given like "Item_unit".
  I want to produce same reults as before. For which before creating a CSV i need to break the "Item" into "Item" and "Unit" and then create the CSV.
  Can anyone tell me efficient way of doing it.
  Any help is appreciated</p>