Re: [xsl] Evaluating parameter in <xsl:when> vs evaluating parameter in <xsl:sort>.

Subject: Re: [xsl] Evaluating parameter in <xsl:when> vs evaluating parameter in <xsl:sort>.
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 24 Jul 2002 13:23:18 +0100
<xsl:variable name="sortParameter">
      <xsl:value-of select="sortby"/>
</xsl:variable>

That makes the sortParameter into a result tree fragment consisting of a
root node and a text node with the string value being the string value
of the first element sortby that's a child of the current node.

Without knowing what is in that element it's hard to guess what
$sortParameter
might be.
xalan:evaluate($sortParameter)
will evaluate the string value of $sortParameter as an XPath.
That is it will evaluate the string value of the sortby child.

test="xalan:evaluate($sortParameter) = 'name'" >

so that will be true if that XPath ever evaluates to the string 'name'
but without knowing what the Xpath is it's hard to guess if it should
evaluate to name.

If by some chance
<xsl:sort select="xalan:evaluate($sortParameter)"
is sorting based on the values of an element called name then most
likely
the test 
 <xsl:when test="xalan:evaluate($sortParameter) = 'name'" >
should be
 <xsl:when test="$sortParameter = 'name'" >
as you want to know if the Xpath is name not if it evaluates to
'name'.

But that is just a guess, given no information.

David



_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

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


Current Thread