title: XSLT Count total number of rows in a Table
body: <p>I'm working with XML that contains HTML Table with rowspan. I need to get the total amount of cols and rows of this table, I need to work this with xslt to do a transformation. 
  I'm trying to do something like this :</p>
  
  <pre><code>&lt;xsl:value of select="count(./tr) - count(./tr/td/@rowspan &gt; 1 and ./tr/td =1)"&lt;/xsl:value-of&gt;          
  </code></pre>
  
  <p>Of course, this doesn't work because I have some <code>&lt;tr&gt;</code> with more than one <code>&lt;td&gt;</code> . I need to count only when this two conditions are checked. I assume xslt looks ALL the <code>&lt;tr&gt;</code> and doesn't check in the same  where the first condition is true.</p>
  
  <p>Any help/suggestion?</p>
  
  <p>In this Example, we have 5  , but the "real" count of  should be 4. (The HTML output has 4 rows). </p>
  
  <pre><code> &lt;table border="2"&gt;
              &lt;tr&gt;
                  &lt;td align="left" colspan="3" valign="top"&gt;
                      text
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td align="left" rowspan="3" valign="top"&gt;
                      text
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td align="left" rowspan="2" valign="top"&gt;
                      text
                  &lt;/td&gt;
                  &lt;td align="left" valign="top"&gt;
                      text
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td align="left" valign="top"&gt;
                      text
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td align="left" valign="top"&gt;
                      text
                  &lt;/td&gt;
                  &lt;td align="left" valign="top"&gt;
                      text
                  &lt;/td&gt;
              &lt;/tr&gt;
  &lt;/table&gt;      
  </code></pre>