This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cannot assign val to sort key


[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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]