Source de tournertables.xsl
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0">
<xsl:output method="xml" indent="yes" />
<!-- Transformer un élément ou un attribut :
quelconque -> on recopie
table -> on tourne -->
<xsl:template match="*|@*">
<xsl:copy>
</xsl:template><xsl:apply-templates select="@*" />
<xsl:choose>
</xsl:copy><xsl:when test="name()='table'">
<xsl:call-template name="TourneTable">
</xsl:when><xsl:with-param name="iCol" select="1" />
<xsl:with-param name="laTable" select="." />
</xsl:call-template><xsl:otherwise>
</xsl:choose><xsl:apply-templates />
</xsl:otherwise>
<!-- La fonction qui tourne une colonne + appel sur la colonne suivante -->
<xsl:template name="TourneTable">
</xsl:stylesheet><xsl:param name="iCol" />
<xsl:param name="laTable" />
<xsl:variable name="cases" select="$laTable/tr/*[position()=$iCol]" />
<xsl:if test="count($cases)>0">
</xsl:template><tr>
<xsl:apply-templates select="$cases" />
</tr><xsl:call-template name="TourneTable">
</xsl:if><xsl:with-param name="iCol" select="$iCol+1" />
<xsl:with-param name="laTable" select="$laTable" />
</xsl:call-template>