[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Evaluating parameter in <xsl:when> vs evaluating p

Subject: Re: 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
xalan evaluate elements
<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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.