I am trying to use the current node attribute as a value to match against the name name in my xml. The xml node is the same name as the handle. There are multiple nodes with different names that correspond to the handle.
As its going over a lot of different nodes with different names, i dont want to write a massive choose statement. please look at the xpath inside apply-template
- its not working, but is there a way to do such a thing?
<xsl:for-each select="data/navigation/page">
<xsl:element name="{@handle}">
<xsl:attribute name="id"><xsl:value-of select="current()/@id"/></xsl:attribute>
<xsl:value-of select="name"/>
<xsl:apply-templates select="/data/[current()/@handle]" mode="page"/>
</xsl:element>
</xsl:for-each>