I need to get the value of the ‘test’ attribute in the xsl:when tag, and the ‘name’ attribute in the xsl:call-template tag. This xpath gets me pretty close:
..../xsl:template/xsl:choose/xsl:when
But that just returns the ‘when’ elements, not the exact attribute values I need.
Here is a snippet of my XML:
<xsl:template match='field'> <xsl:choose> <xsl:when test='@name='First Name''> <xsl:call-template name='handleColumn_1' /> </xsl:when> </xsl:choose>
Steve Cooper answered the first part. For the second part, you can use:
Which will match specifically the xsl:when in your above snippet. If you want it to match generally, then you can use: