You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by kkumari <kk...@cinoni.com> on 2001/05/18 12:52:42 UTC

Re: xsl:if test="attribute=variable" does not work

To make it work try 
<xsl:if test="@id[.=$var0]">

----- Original Message ----- 
From: "Wieser Daniel" <Da...@softlab.de>
To: <xa...@xml.apache.org>
Sent: Wednesday, July 18, 2001 3:48 PM
Subject: xsl:if test="attribute=variable" does not work


> Hi all,
> 
> I'm having a problem with the xsl:if element as it is used 
> in the following xsl snippet. I don't have any idea why it
> doesn't work and would appreciate any helpful comments.
> 
> 
> <xsl:template match="gutschrift"> 
>   <xsl:variable name="var0" select="'VT'"/>
>   <xsl:variable name="var1" select="VT"/>
>   
>   <xsl:if test="@id=$var0">
>     test 1
>   </xsl:if>
>   <xsl:if test="@id=$var1">
>     test 2
>   </xsl:if>
>    
>   <xsl:value-of select="@id=$var0"/>  ** prints out 'false' **
>   <xsl:value-of select="@id=$var1"/>  ** prints out 'false' ** 
>   <xsl:value-of select="@id"/>   ** prints out 'VT' **
> 
> </xsl:template>
> 
> Regards 
> 
> Daniel