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

RE: sort parameter problem

Subject: RE: sort parameter problem
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Mon, 24 Sep 2001 18:56:27 +0100
xsl sort parameter
>
> The following construct hasn't any sort effect when called
> with sort=bar
> parameter:
> <xsl:template name="list-foos">
>   <xsl:param name="sort"/>
>   <xsl:for-each select="foos/foo">
>     <xsl:sort select="$sort"/>
>     [..]
>   </xsl:for-each>
> </xsl:template>

It has no effect because every node has the same value of the sort key, that
is, the value of the parameter $sort.
>
> The XSL spec says:
> xsl:sort has a select attribute whose value is an expression.
>
And the sort key is the value of that expression. It's not the value of the
expression that results from evaluating the expression. In other words, the
sort key is the value of $sort, not the value of the expression contained in
$sort.

This is a FAQ. The most common circumventions are:

(a) use a construct such as select="*[name()=$name]"
(b) use saxon:evaluate() or xalan:evaluate()
(c) modify the stylesheet before use

Mike Kay


 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.