1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| <xsl:template match="/">
<table>
<xsl:for-each select="/root/*">
<xsl:sort select="count(*[not(@visible) and name()!='ID'])" order="descending"/>
<xsl:if test="position()=1">
<xsl:variable name="lemax" select="."/>
<xsl:choose>
<xsl:when test="contains(*/*[name()=$champTri],'/')">
<xsl:for-each select="/root/*">
<xsl:sort select="concat(substring(*[name()=$champTri],7,4), substring(*[name()=$champTri],4,2), substring(*[name()=$champTri],1,2))" order="{$sensTri}"/>
<xsl:variable name="cur" select="."/>
<tr>
<xsl:for-each select="$lemax/*">
<xsl:variable name="n" select="name()"/>
<xsl:if test="not(@visible)">
<td>
<xsl:value-of select="$cur/*[name()=$n]"/>
</td>
</xsl:if>
</xsl:for-each>
</tr>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="/root/*">
<xsl:sort select="*[name()=$champTri]" order="{$sensTri}"/>
<xsl:variable name="cur" select="."/>
<tr>
<xsl:for-each select="$lemax/*">
<xsl:variable name="n" select="name()"/>
<xsl:if test="not(@visible)">
<td>
<xsl:value-of select="$cur/*[name()=$n]"/>
</td>
</xsl:if>
</xsl:for-each>
</tr>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
</table>
</xsl:template> |