[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

sorting parameter ?

Subject: sorting parameter ?
From: "Ricaud Matthieu" <matthieu.ricaud@xxxxxxx>
Date: Fri, 5 Mar 2004 15:46:51 +0100
selectnodes sort
Hello !
I would like to sort xml datas to display them in function of the user's
sort choice.
I send the sorting parameter (chosen by the user in a HTML form) to the xsl
stylesheet with the function addParameter from my xslt processor.
As I cannot do :

<xsl:sort select="$SortParam" case-order="lower-first"/>

I must evaluate the parameter as an XPath expression, which i have done
using the *evaluate* function of the *dyn* namespace :

<xsl:sort select="dyn:evaluate(.,$SortParam)" case-order="lower-first"/>

This is my xsl declaration :

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:dyn="http://exslt.org/dynamic"
                xmlns:msxsl="urn:schemas-microsoft-com:xslt"
                extension-element-prefixes="dyn msxsl">

and the dyn function is defined as follow :

	<msxsl:script implements-prefix="dyn" language="jscript">
	   function evaluate(context, expression)
	      {
	         return context.nextNode().selectNodes(expression);
	      }
	</msxsl:script>

It work fine but I'm just wondering if there's not another way of doing it
using standard xsl. I have seen things with <xsl:key> but i don't know if it
is appropiate here and actually i don't really understand what's this
element aims at...

Do you have suggestions ?
In advance thanks,

Matthieu.


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.