Wow, I got it! The problem wasn't originated in the usage
of the xsl:if element.
I changed the output of the attribute '@id' to see the
content more exactly. The usage of
<fo:block>x<xsl:value-of select="@id"/>x</fo:block>
printed out "x VT x".
I'm using XSP to create the XML file and now changed the formatting
of the XSP file from
<xsp:element name="gutschrift">
<xsp:attribute name="id">
<xsp:expr>key.toString()</xsp:expr>
</xsp:attribute>
...
...
to
<xsp:element name="gutschrift">
<xsp:attribute
name="id"><xsp:expr>key.toString()</xsp:expr></xsp:attribute>
...
...
and now it works!
> -----Original Message-----
> From: kkumari [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 18, 2001 12:53 PM
> To: [EMAIL PROTECTED]
> Subject: Re: xsl:if test="attribute=variable" does not work
>
>
> To make it work try
> <xsl:if test="@id[.=$var0]">
>
> ----- Original Message -----
> From: "Wieser Daniel" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> 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
>