Hi Aderson,
Can you help me with this problem? I your XSLT templates were very helpful, but I still need more practice to fully understand how to use them properly...
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="SkinPath"></xsl:param>
<xsl:output method="html"/>
<xsl:template match="/*">
<xsl:apply-templates select="root" />
</xsl:template>
<xsl:template match="root">
<ul id="mainnav">
<xsl:apply-templates select="node" />
</ul>
</xsl:template>
<xsl:template match="node">
<li>
<xsl:attribute name="class">
<xsl:text></xsl:text>
<xsl:if test="@first = 1"><xsl:text> </xsl:text>first</xsl:if>
<xsl:if test="@last = 1"><xsl:text> </xsl:text>last</xsl:if>
<xsl:if test="@selected = 1"><xsl:text> </xsl:text>item-active</xsl:if>
</xsl:attribute>
<xsl:choose>
<xsl:when test="@enabled = 1">
<a href="{@url}">
<xsl:value-of select="@text" />
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@text" />
</xsl:otherwise>
</xsl:choose>
<xsl:if test="node">
<ul>
<xsl:apply-templates select="node" />
</ul>
</xsl:if>
</li>
</xsl:template>
</xsl:stylesheet>
This is my code, I understand how to add classes to the "li" elements... but how would I add a class of "current", to the <a> element instead?
Thanks in advance