title: Adding rowspan via XSL
body: <p>I have the following xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  
  &lt;Loci&gt;
      &lt;Locus&gt;
          &lt;Id&gt;MTBC1726&lt;/Id&gt;
          &lt;Alleles&gt;
              &lt;Allele&gt;
                  &lt;Name&gt;1.0&lt;/Name&gt;
                  &lt;Description&gt;No annotation provided&lt;/Description&gt;
              &lt;/Allele&gt;
              &lt;Allele&gt;
                  &lt;Name&gt;2.0&lt;/Name&gt;
                  &lt;Description&gt;No annotation provided&lt;/Description&gt;
              &lt;/Allele&gt;
          &lt;/Alleles&gt;
      &lt;/Locus&gt;
      &lt;Locus&gt;
          &lt;Id&gt;MTBC3142&lt;/Id&gt;
          &lt;Alleles&gt;
              &lt;Allele&gt;
                  &lt;Name&gt;1.0&lt;/Name&gt;
                  &lt;Description&gt;No annotation provided&lt;/Description&gt;
              &lt;/Allele&gt;
          &lt;/Alleles&gt;
      &lt;/Locus&gt;
  &lt;/Loci&gt;
  </code></pre>
  
  <p>And I want to create the following result:</p>
  
  <p><img src="https://i.stack.imgur.com/zwbpi.png" alt="enter image description here"></p>
  
  <p>which, in HTML, would look like this:</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  
  &lt;table border="1"&gt;
    &lt;tr&gt;
      &lt;th&gt;Locus&lt;/th&gt;
      &lt;th&gt;Allele&lt;/th&gt;
      &lt;th&gt;Description&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td rowspan="2"&gt;MTBC1726&lt;/td&gt;
      &lt;td&gt;1.0&lt;/td&gt;
      &lt;td &gt;No annotation provided&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;2.0&lt;/td&gt;
      &lt;td &gt;No annotation provided&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td &gt;MTBC3142&lt;/td&gt;
      &lt;td&gt;1.0&lt;/td&gt;
      &lt;td &gt;No annotation provided&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I have created the following XSL:</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;table border="1"&gt;
        &lt;tr&gt;
          &lt;th&gt;Locus&lt;/th&gt;
          &lt;th&gt;Allele&lt;/th&gt;
          &lt;th&gt;Description&lt;/th&gt;
        &lt;/tr&gt;
        &lt;xsl:for-each select="Loci/Locus"&gt;
        &lt;tr&gt;
          &lt;td&gt;&lt;xsl:value-of select="Id"/&gt;&lt;/td&gt;
          &lt;xsl:for-each select="Alleles/Allele"&gt;
            &lt;td&gt;&lt;xsl:value-of select="Name"/&gt;&lt;/td&gt;
            &lt;td&gt;&lt;xsl:value-of select="Description"/&gt;&lt;/td&gt;
          &lt;/xsl:for-each&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>
  
  <p>but that produces a table like this:</p>
  
  <p><img src="https://i.stack.imgur.com/3AcTP.png" alt="enter image description here"></p>
  
  <p>So, my question is: how do I add the <code>rowspan</code> attribute with a count based on the number of <code>&lt;Allele&gt;</code> nodes?</p>