title: How to calculate the test results pass percentage in XSLT
body: <p>The input is an XML file </p>
  
  <pre><code>&lt;test-results name="project name" total="73" errors="0" failures="43" not-run="0" inconclusive="0" ignored="0" skipped="0" invalid="0" date="2016-01-05" time="20:32:22"&gt;
  .......
  &lt;/test-results&gt;
  </code></pre>
  
  <p>I want to calculate the "No of pass results" and "Pass Percentage". I have done with the No of pass results. It is working fine</p>
  
  <pre><code>               &lt;tr&gt;
                  &lt;td&gt;Number of Passes&lt;/td&gt;
                  &lt;td&gt;
                    &lt;xsl:variable name="failures" select="@failures"/&gt;
                    &lt;xsl:variable name="total" select="@total"/&gt;
                    &lt;xsl:choose&gt;
                      &lt;xsl:when test="$failures != ''"&gt;
                        &lt;xsl:value-of select="($total - $failures)"/&gt;
                      &lt;/xsl:when&gt;
                      &lt;xsl:otherwise&gt;
                        &lt;xsl:value-of select="@total"/&gt;
                      &lt;/xsl:otherwise&gt;
                    &lt;/xsl:choose&gt;
                  &lt;/td&gt;
                &lt;/tr&gt;
  </code></pre>
  
  <p>Now I want to calculate the pass percentage(eg :- 87.45%). I tried the below logic. but it is throwing an exception</p>
  
  <pre><code>&lt;tr&gt;
          &lt;td&gt;Success Rate&lt;/td&gt;
          &lt;td&gt;
            &lt;xsl:variable name="Pass" select="@total - @failures"/&gt;
            &lt;xsl:variable name="totalNo" select="@total"/&gt;
            &lt;xsl:value-of select="($Pass/$totalNo)*100"/&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
  </code></pre>
  
  <p>Can anyone help me out to calculate the pass percentage?
  Thanks in advance.</p>