This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: cannot assign val to sort key
- From: "Thomas B. Passin" <tpassin at mitretek dot org>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Fri, 8 Feb 2002 14:52:42 -0500
- Subject: Re: [xsl] cannot assign val to sort key
- References: <20020208192019.34651.qmail@web14504.mail.yahoo.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
[alex]
> From an asp page I pass values for sort key and sort
> order into variables in my xsl:
>
> <xsl:variable name="sortKey" />
> <xsl:variable name="sortOrder" />
>
> I know this part works b/c I've printed out their
> values. But I can't seem to assign assign the values
> of these variables to my <xsl:sort>. Here's what I'm
> doing:
>
> <xsl:sort select="$sortKey" order="{$sortOrder}" />
>
> $sortKey is the variable name, but it doesn't get
> picked up... what am I diong wrong?
>
You don't show what values you are assigning to these variables. In the
case of sortOrder, if you were writing it by hand you would have to write
<xsl:variable name="sortOrder" select='"descending"'/>
Notice that "descending" is in double quotes to make it a string instead of
a nodeset. This will work for specifying the sort order (I tested it). I
have no idea what values you are trying to assign for sortKey nor what the
context is for the sorting loop, so I can't say what's wrong there.
I suggest that you get this working in a hand-written stylesheet first, then
try to duplicate those results.
Cheers,
Tom P
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list