title: XSLT equation using SP list fields
body: <p>I have a SP Dataview that I have converted to XSLT, so that I could add a header displaying a percentage (Complete). <br/>Before I converted the dvwp to xslt, I added two count headers- one on Complete, and another on LastName. They worked wonderfully- showing me the # of records and the # of records with a value in the complete field.  However, when I converted the dv to xslt I realized that I lost my headers :( <br/><br/>
  So, I am adding them back in using xslt. Currently the XPath code for the equation that I have is <code>&lt;xsl:value-of select="count($Rows) div count($Rows)" /&gt;</code>.<br/>
  How do I get the total # of Yes values that are in my Complete field?  </p>
  
  <p><strong>UPDATE1:</strong><br/>
  Found this <a href="http://www.endusersharepoint.com/STP/viewtopic.php?f=14&amp;t=534" rel="nofollow">http://www.endusersharepoint.com/STP/viewtopic.php?f=14&amp;t=534</a> and tried it, however causes the following error- <strong>Failed setting processor stylesheet: 0x80004005: Argument 1 must return a node-set. -->count(/dsQueryResponse/Rows/Row='Y')&lt;--</strong> </p>
  
  <p><strong>UPDATE2:</strong><br/>
  Complete is the name of a field w/i my XSLT dataset. The return type is either Y or blank. For grins I tried <code>&lt;xsl:value-of select="count(/xpath/to/parent/element[@Complete eq 'Y']) div count($Rows)" /&gt;</code> however I recieved the following error- <strong>Failed setting processor stylesheet: 0x80004005: Expected token ']' found 'NAME'.count((/xpath/to/parent/element[@Complete -->eq &lt;--'Y']) div count($Rows)</strong> Am starting to think that there may be a problem w/ 'eq'.... Referencing my XML operators...</p>
  
  <p><strong>UPDATE3:</strong><br/></p>
  
  <pre><code>&lt;xsl:value-of select="count(/xpath/to/parent/element[@Complete = 'Y']) div count($Rows)" /&gt;
  </code></pre>
  
  <p>Okay so it still says 0, but I think the reason why it's not showing the correct answer is b/c it is expecting to show an integer, and obviously the value being returned from the equation is going to be a decimal... Have been fiddling with the equation in XPath... here's what I've tried- </p>
  
  <pre><code>count(/xpath/to/parent/element[@Complete = 'Y']) div count($Rows)*100
  (count(/xpath/to/parent/element[@Complete = 'Y']) div count($Rows))*100
  100(count(/xpath/to/parent/element[@Complete = 'Y']) div count($Rows))
  </code></pre>
  
  <p><strong>UPDATE4:</strong><br/>
  So I know my previous thought that the correct number not showing b/c it was a float is not correct, as all numbers in XPath and XSLT 1.0 are floats. <A href="http://books.google.com/books?id=W6SpffnfEPoC&amp;pg=PA552&amp;lpg=PA552&amp;dq=xpath+1.0+floating+point+numbers&amp;source=bl&amp;ots=DQPqnQM-sD&amp;sig=fngHN2CsCXd8piLyNuPXMLfINF0&amp;hl=en&amp;sa=X&amp;ei=_xsUT6nDOOXz0gGB_IipAw&amp;ved=0CFAQ6AEwCA#v=onepage&amp;q=xpath%201.0%20floating%20point%20numbers&amp;f=false" rel="nofollow">Reference</A></p>
  
  <p><strong>UPDATE5:</strong><br/>
  Upon further investigation, I have found that the problem lies with the <code>count(/xpath/to/parent/element[@Complete = 'Y'])</code> part of my equation, as this is returning 0 instead of a value. [i know i have at least 3 'Y' vals in my Complete col]</p>
  
  <p><strong>UPDATE6</strong>: <br/></p>
  
  <pre><code>&lt;records*&gt;
  &lt;record*&gt;
    &lt;last_name&gt;&lt;/last_name&gt;
    &lt;first_name&gt;&lt;/first_name&gt;
    &lt;mi&gt;&lt;/mi&gt;
    &lt;office_symbol&gt;&lt;/office_symbol&gt;
    &lt;geo_location&gt;&lt;/geo_location&gt;
    &lt;complete&gt;&lt;/complete&gt;
    &lt;date_complete&gt;&lt;/date_complete&gt;
    &lt;date_expires&gt;&lt;/date_expires&gt;
    &lt;email&gt;&lt;/email&gt;
    &lt;supervisor&gt;&lt;/supervior&gt;
  &lt;/record*&gt;
  &lt;/records*&gt;
  </code></pre>
  
  <p>*i don't know what these nodes are called as my data is coming from a database and not an xml file, i just made up record/records
  <br/><br/>
  <strong>UPDATE7</strong><br/>
  Going back to my original question. I am still trying to find out the XPath equation to display the number of parents (record in the XML i posted above) where the complete node = Y.
  <br/><br/>
  <strong>UPDATE8</strong><br/>
  Ok. So I have edited and tested using <a href="http://www.w3schools.com/xsl/tryxslt.asp?xmlfile=cdcatalog&amp;xsltfile=tryxsl_value-of" rel="nofollow">http://www.w3schools.com/xsl/tryxslt.asp?xmlfile=cdcatalog&amp;xsltfile=tryxsl_value-of</a>. Working XSLT to count the # of Complete = Y is <code>&lt;xsl:value-of select="count(catalog/cd [complete = 'Y'])" /&gt;</code> so theen I put EXACTLY what works on W3schools into my SP Dataview and I get nothing... just an empty space. Why doesn't the code work in my SPDV?</p>