Re: [xsl] Dynamic Sorting

Subject: Re: [xsl] Dynamic Sorting
From: "Michael H. Semcheski" <mhs-list@xxxxxxxxx>
Date: Thu, 07 Nov 2002 14:58:07 -0500


In reality we are not going to hard code the variable values like this,
but rather pull them in from another document by way of the document()
function, but that's not important right now.

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. You can specify attribute
value templates for xsl:sort's other attributes, for instance the
article at
http://www.biglist.com/lists/xsl-list/archives/200012/msg00392.html
demonstrates how to dynamically specify a descending or ascending sort
order. However you can't do this for the select attribute. Short of
creating nonportable XSL by using saxon:evaluate() or xalan:evaluate() I
can't see a way around this. Any suggestions? Can this kind of dynamic
sorting be done at all?



Rather than pull in the values from an external document, why not create a stylesheet (a) that takes that external document (b) and transforms it into the stylesheet as you have it (c), with the xsl:sort attributes set up as defined in document (b)?




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


Current Thread