xsl-list
[Top] [All Lists]

Re: Unexpected behavior with xsl:choose, xsl:when, xsl:variable

2003-08-08 08:20:18

  <xsl:variable name="var1">
  <xsl:value-of select="parm"/>
  </xsl:variable>


Its almost always better to go


<xsl:variable name="var1" select="parm"/>

unless you really need to create a result tree fragment.
(Although that will make no difference to the result here)


I have displayed the variable before the test for
debugging purposes and the variable is indeed set to
'A', but the logic doesn't seem to follow.

are you sure it hasn't aquired any white space?
check by looking at eg
[[[<xsl:value-of select="$var1"/>]]]
or
[[[<xsl:value-of select="string-length($var1)"/>]]]

if it is white space then you may want to use

test="normalize-space($var1)='A'">


David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>