+ <xsl:apply-templates select='@*[local-name() != "style"]' />
+ <tr>
+ <td>
+ <xsl:for-each select='../*/xhtml:tr'>
+ <xsl:sort select='count(*)' data-type='number' order='descending' />
+ <xsl:if test='position()=1'>
+ <xsl:attribute name='colspan'>
+ <xsl:value-of select='count(*)' />
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:for-each>
+ <hr/>
+ </td>
+ </tr>
+ <tr>
+ <xsl:for-each select='../xhtml:thead[1]/xhtml:tr[1]/*'>
+ <xsl:copy>
+ <xsl:value-of select='.' />
+ </xsl:copy>
+ </xsl:for-each>
+ </tr>
+ <xsl:apply-templates select='node()' />