This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: problem with <xsl:if>
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] problem with <xsl:if>
- From: mjyoungblut at mmm dot com
- Date: Wed, 18 Apr 2001 15:29:02 -0500
- Reply-To: xsl-list at lists dot mulberrytech dot com
Jay,
You are further down the tree when you try to access the 'edit' attribute
when you are doing your test.
Try this:
<xsl:template match="addresslist">
<xsl:variable name="EDIT" select="@edit"/>
<b><xsl:value-of select="@name"/></b><br/>
<xsl:for-each select="address">
<xsl:value-of select="name"/>
<xsl:if test="{$EDIT}='yes'">
...add something...
</xsl:if><br/>
</xsl:for-each><p/>
</xsl:template>
><xsl:template match="addresslist">
> <b><xsl:value-of select="@name"/></b><br/>
> <xsl:for-each select="address">
> <xsl:value-of select="name"/>
> <xsl:if test="addresslist[@edit='yes']/address">
> ...add something...
> </xsl:if><br/>
> </xsl:for-each><p/>
></xsl:template>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list