title: XSLT function " substring-before " / " substring-after "
body: <p>I have following XML code</p>
  
  <pre><code>&lt;Testlog&gt;   
   &lt;Event Type="General" 
     Headline="Sys_TmxProcesses: Step: 1; Action:" 
     Result="INFORMATION"&gt;
    &lt;/Event&gt;
   &lt;Event Type="General" 
     Headline="Test_013 testMain: Step 1 Passed" 
     Result="INFORMATION"&gt;
    &lt;/Event&gt;
  &lt;Event Type="General" 
     Headline="logStepBegin: Step: 1.001; Action:" 
     Result="INFORMATION"&gt;
    &lt;/Event&gt;      
   &lt;Event Type="General" 
     Headline="onErrorExit: Step 4.001 Failed" 
     Result="WARNING"&gt;
    &lt;/Event&gt;  
   &lt;Event Type="Script End" 
     Headline="Script end [DSE.DseBalanceInquiry_FC_Test_013]" 
     Result="WARNING"&gt;
    &lt;/Event&gt;
  
   &lt;Event Type="Script End" 
     Headline="Script end [DSE.DseBalanceInquiry_FC_Test_001]" 
     Result="FAIL"&gt;
    &lt;/Event&gt;     
  &lt;/Testlog&gt;  
  </code></pre>
  
  <p>Now i'd like to only grab the 
  1.Type
  2.Result
  3.'Step number' Which i have to get from the Headline
  4.Headline
  5.'Step Status' which i have to get from the Headline, which is after the step number. </p>
  
  <p>the following xslt gives values for Type,Result and Headlines.
  But i am unable to get 
  (1)Step Number (only number should be displayed) 
  (2)Step Status(Passed/Failed should display not the number)</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;xsl:template match="/"&gt;
   &lt;html&gt;
   &lt;body&gt;
    &lt;h2&gt;Report&lt;/h2&gt;
     &lt;table border="1"&gt;
     &lt;tr bgcolor="#9acd32"&gt;
      &lt;th style="text-align:left"&gt;Type&lt;/th&gt;
      &lt;th style="text-align:left"&gt;Result&lt;/th&gt;
      &lt;th style="text-align:left"&gt;Step Number&lt;/th&gt;
      &lt;th style="text-align:left"&gt;Headline&lt;/th&gt;
      &lt;th style="text-align:left"&gt;Step Status&lt;/th&gt;
    &lt;/tr&gt;
    &lt;xsl:for-each select="Testlog/Event[@Result='WARNING' or @Result='FAIL' or contains(@Headline, 'Step ')]"&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;xsl:value-of select="@Type"/&gt;&lt;/td&gt;
      &lt;td&gt;&lt;xsl:value-of select="@Result"/&gt;&lt;/td&gt;
      &lt;td&gt;&lt;xsl:value-of select="substring-after(@Headline,'Step ')"/&gt;&lt;/td&gt;
     &lt;td&gt;&lt;xsl:value-of select="@Headline"/&gt;&lt;/td&gt;
     &lt;td&gt;&lt;xsl:value-of select="substring-after(@Headline,'Step ')"/&gt;&lt;/td&gt;
     &lt;/tr&gt;
    &lt;/xsl:for-each&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>