Re: [xsl] Dynamic Sorting

Subject: Re: [xsl] Dynamic Sorting
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Thu, 07 Nov 2002 21:08:51 +0100
Ben Macaulay wrote:
Question -> Can you define a template that allows you to define, at
runtime, the elements that you want to sort on?
...
The problem is, later on in the XSL we can't have <xsl:sort
select="{$sort-by-element-1}" /> since xsl:sort's select attribute
doesn't accept attribute value templates.

FAQ. Note that you have to supply an XPath as an xsl:sort select attribute. If your sorting criterium is a simple element name, use <xsl:sort select="*[name()=$sort-by-element-1]"/>

For more complicated expressions you may have some chance to extend
on this, but often you'll have indeed to resort to an evaluate()
function.

J.Pietschmann



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


Current Thread