Policz <td> Elementy w xhtml <table> z XSLT 1.0

Mam XSLT 2.0, który przekształca tabelę xhtml w tabelę XML InDesign. Ten XSLT liczymaksymalny numer z<td> Elementy w każdym rzędzie<tr> Wiersz 7 w szablonie poniżej (max(for $td in //tr return count($td/td))).

<xsl:template match="table">
    <xsl:element name="id_table">
        <xsl:attribute name="aid:trows">
            <xsl:value-of select="count(child::*/tr)"/>
        </xsl:attribute>
        <xsl:attribute name="aid:tcols">
            <xsl:value-of select="max(for $td in //tr return count($td/td))"/>
        </xsl:attribute>
        <xsl:apply-templates/>
    </xsl:element>
</xsl:template>

Nie mam pojęcia, jak to zrealizować dzięki XSLT 1.0 - wszelkie pomysły byłyby bardzo mile widziane! Niestety jest tylko procesor 1.0 w potoku przepływu pracy.

questionAnswers(1)

yourAnswerToTheQuestion