It worked the way I had it: <xsl:when test="$stock != ''">
The problem was that I assigned the wrong value to the variable. So it couldn't work Thanks anyway, Barthi > -----Original Message----- > From: Jeroen Reijn [mailto:[EMAIL PROTECTED] > Sent: Monday, January 16, 2006 6:40 PM > To: [email protected] > Subject: Re: How to test if XSL-variable is empty?? > > Hi! > > I guess you could also try > > <xsl:when test="string-length($stock)>0"> > </xsl:when> > > Regards > > Reijn > > > Christian Barth wrote: > > Hi again! > > > > Now I have the following Code-snippet for you: > > > > > > <xsl:variable name="stock" select="@stockwerk"></xsl:variable> > > > > <xsl:choose> > > > > *<xsl:when test="$stock != '' ">* > > > > <td><xsl:value-of select="@typ" /> in Stockwerk "$stock" > von Gebaeude > > "<xsl:value-of select="gebaeude" />" in Bauvorhaben "<xsl:value-of > > select="bauvorhaben" />"</td> > > > > <td align="center"><b><xsl:value-of select="gesamtSim" /></b></td> > > > > </xsl:when> > > > > <xsl:otherwise> > > > > <td>Gebaeude "<xsl:value-of select="gebaeude" />" in Bauvorhaben > > "<xsl:value-of select="bauvorhaben" />"</td> > > > > <td align="center"><b><xsl:value-of select="gesamtSim" /></b></td> > > > > </xsl:otherwise> > > > > </xsl:choose> > > > > > > > > In the bold line I want to test, if the variable "stock" > contains an > > empty string or anything else. But with the code above, > Cocoon always > > jumps into the Otherwise-part. > > > > What's wrong there? > > > > > > > > > > > > Thanks, > > > > Barthi > > > > -- > Met vriendelijke groet, > > Jeroen Reijn > > Hippo > > Oosteinde 11 > 1017WT Amsterdam > The Netherlands > Tel +31 (0)20 5224466 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
