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

RE: Re: <xsl:sort select=borrower order=descending/> q

Subject: RE: Re: <xsl:sort select=borrower order=descending/> question
From: "dmitrik@xxxxxxxxxxxxxx" <dmitrik@xxxxxxxxxxxxxx>
Date: Tue, 17 Jun 2003 15:48:06 -0400
xsl sort select order
Is this what you are referring to?
There is an html drop down list with vbscript which allows columns 
in the table to be selected, and then a dropdown with ascending or 
descending. How can these values be passed to these
variables?
<xsl:sort order="{$order}" select="*[name()=$sortColumn]"/>

tia,
dk

dynamically set the sort order
 
 Dimitre Novatchev 

> I am trying to dynamically set sort order and sort column in my 
> XSLT. It seems that I can not use an expression for "order".
>
> <xsl:apply-templates select="Uow">
>   <xsl:sort select="$sortColumn" order="$sortOrder"/>
>   <xsl:with-param name="from" select="$startRow"/>
>   <xsl:with-param name="to" select="$endRow"/>
> </xsl:apply-templates>

All attributes of xsl:sort with the exception of "select" can be specified
as AVT-s.

The "select" attribute can be any XPath expression. Certainly, an attempt
to put an XPath expression in a variable and pass this variable as the
(complete) value of the "select: attribute -- this will fail for xsl: sort
as in any such attempt in XSLT, because XPath expressions are not evaluated
dynamically.

However, if you need to specify the name of a child element, then you can
use an expression like this:

*[name()=$sortColumn]
Therefore, one possible way to achieve your wanted results is:

<xsl:sort order="{$order}" select="*[name()=$sortColumn]"/>
 


Original Message:
-----------------
From: Dimitre Novatchev dnovatchev@xxxxxxxxx
Date: Tue, 17 Jun 2003 20:06:20 +0200
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Re: <xsl:sort select="borrower" order="descending"/> question


http://dpawson.co.uk/xsl/sect2/N6461.html#d6859e950


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL


<dmitrik@xxxxxxxxxxxxxx> wrote in message
news:293580-220036217135613598@xxxxxxxxxxxxxxxxxxxxxx
>
> is there a way to pass a variable into the select
>  <xsl:sort select="borrower" order="descending"/>
>
> so that different values can be sorted in the xml?
>
>  <xsl:for-each select="trades/trade">
>        <xsl:sort select="borrower" order="descending"/>
>
> tia,
> dk
>
> --------------------------------------------------------------------
> mail2web - Check your email from the web at
> http://mail2web.com/ .
>
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>




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


--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .



 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.