xsl-list
[Top] [All Lists]

Re: Dynamic Sorting

2002-11-07 13:08:51
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



<Prev in Thread] Current Thread [Next in Thread>