C
Colin Walls
Fencing tournaments use a programme called Engarde to run tournaments. One
of the features of the programme is the generation of a "transfer" file in
XML format. This contains lines with ranking information.
<Tireur ID="17" Nom="AJAMI" Prenom="Rashid" DateNaissance="00.04.1990"
Sexe="M" Club="SUSSEX HOUSE" Licence="46379" Classement="12" Statut="N" />
I want to transform the set of ranks into an HTML file, with the medal
winning positions highlighted using a CSS class statement on a <TR> tag to
do this.
The easiest thing would weem to be to create a variable inside an
<xsl:choose> and put the name of the class into this. One could then use
<xsl:attribute> to set the class. Unfortunately the variable only seems to
have scope inside the <xsl:choose> and I am reduced to the following:
<xsl:choose>
<xsl:when test="@Classement = $first">
<tr class="first">
<xsl:apply-templates select="@Classement" />
<xsl:apply-templates select="@Nom" />
<xsl:apply-templates select="@Prenom" />
<xsl:choose>
<xsl:when test="@Club != $empty_string">
<xsl:apply-templates select="@Club" />
</xsl:when>
<xsltherwise>
<td> </td>
</xsltherwise>
</xsl:choose>
</tr>
</xsl:when>
<xsl:when test="@Classement = $second">
<tr class="second">
<xsl:apply-templates select="@Classement" />
etc.
I would be grateful to anyone who could point me to a better way. I can
provide a full copy of the XML file and my XSLT file if required.
of the features of the programme is the generation of a "transfer" file in
XML format. This contains lines with ranking information.
<Tireur ID="17" Nom="AJAMI" Prenom="Rashid" DateNaissance="00.04.1990"
Sexe="M" Club="SUSSEX HOUSE" Licence="46379" Classement="12" Statut="N" />
I want to transform the set of ranks into an HTML file, with the medal
winning positions highlighted using a CSS class statement on a <TR> tag to
do this.
The easiest thing would weem to be to create a variable inside an
<xsl:choose> and put the name of the class into this. One could then use
<xsl:attribute> to set the class. Unfortunately the variable only seems to
have scope inside the <xsl:choose> and I am reduced to the following:
<xsl:choose>
<xsl:when test="@Classement = $first">
<tr class="first">
<xsl:apply-templates select="@Classement" />
<xsl:apply-templates select="@Nom" />
<xsl:apply-templates select="@Prenom" />
<xsl:choose>
<xsl:when test="@Club != $empty_string">
<xsl:apply-templates select="@Club" />
</xsl:when>
<xsltherwise>
<td> </td>
</xsltherwise>
</xsl:choose>
</tr>
</xsl:when>
<xsl:when test="@Classement = $second">
<tr class="second">
<xsl:apply-templates select="@Classement" />
etc.
I would be grateful to anyone who could point me to a better way. I can
provide a full copy of the XML file and my XSLT file if required.