This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Contitional statement
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] Contitional statement
- From: Goetz Bock <bock at blacknet dot de>
- Date: Wed, 13 Jun 2001 01:18:25 +0200
- References: <F31ZbLAX3cf3ednHM3S0001fff0@hotmail.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
On Tue, Jun 12 '01 at 20:45, Earl Spencer wrote:
> Can we have a conditional statement for an <xsl:value-of>
>
> like
> <xsl:value-of select="ROW/KEY[id=$var]"/>
> is this right to use....
This is correct XSL-T, but the result might not be what you expect:
input:
<row>
<key id="foo">foo1</key>
<key id="bar">bar1</key>
<key id="foo">foo2</key>
<key id="bar">bar2</key>
</row>
<xsl:variable name="var">foo</xsl:variable>
<xsl:value-of select="row/key[id=$var]"/>
will result in:
"foo1 foo2"
with out quotes, or even "foo1foo2", but I'd expect the first one.
But it works.
Goetz.
PGP signature