Re: [xsl] select attribute value based on attribute value

Subject: Re: [xsl] select attribute value based on attribute value
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 16 Mar 2001 16:19:54 +0000
At 08:03 PM 3/16/01, Chris wrote:
On Behalf Of Alex Reuter

This runs through them all and displays @att1

<xsl:for-each select="listOfelements/animal">
        <xsl:if test=".[@att2='frogKEY']">
                <xsl:value-of select="@att1"/>
        </xsl:if>
...

Unfortunately, I don't think you can say ".[@att2='frogKEY']" -- you can't use a predicate on top of a location step, only as part of one; and . is a complete (abbreviated) step.


But you don't need to, in any case. <xsl:if test="@att2='frogKEY'"> will work fine.

Cheers,
Wendell



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread