title: How to divide with XSL - but the way I am trying to do this is a little tricky
body: <p>So i found out how to add up values in XSL, the following link will show you what I done to get it.</p>
  
  <p><a href="https://stackoverflow.com/questions/6092687/how-to-use-the-count-function-is-xsl-trying-to-count-the-amount-of-as-there">How to use the count() function is XSL - trying to count the amount of &quot;A&quot;s there are in a report</a></p>
  
  <p>But now I want find out the percentage each report value has.</p>
  
  <p>So, what I mean is, there's 8 total reports, but 'A' only has 4 of them, so that means 'A' has %50 of the total report values.</p>
  
  <p>And 'B' has 3, so that means it has %37.5 of the total report values and so on.</p>
  
  <p>How do I do this?</p>
  
  <p>I figure I get the number of each report value, like 'A' which is 4 - then i need to use the count() function to count the total number of reports, and divide 'A' by the total value.</p>
  
  <p>Im lost on how to get this done.</p>
  
  <p>I know that this gets the total number of 'A's.</p>
  
  <pre><code>&lt;xsl:value-of select="count(/class/student[grade='A'])"/&gt; 
  </code></pre>
  
  <p>And this gets the total number of reports.</p>
  
  <pre><code>&lt;xsl:value-of select="count(/class/student/grade)"/&gt;
  </code></pre>
  
  <p>But I dont know how to get the first value and divide it by the second * 100. I havnt figured out a way to give each value a name or ID so I can reference them - im completely lost.</p>