Subject: [xsl] Fwd: Re: unable to dynamically set sort order From: "bharat chintapally" <hydbad@xxxxxxxxxxx> Date: Tue, 22 May 2001 09:28:44 -0400 |
Thanks --bharat
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx> To: hydbad@xxxxxxxxxxx CC: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: unable to dynamically set sort order Date: Mon, 21 May 2001 21:37:28 -0700 (PDT)
This must be a FAQ!:
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]"/>
Cheers, Dimitre Novatchev.
bharat chintapally wrote:
Hello All: 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>
** $sortColumn and $sortOrder are variables here
Is there any other way I can solve this issue? The reason I need to do this is to keep track of users preference between requests when they are sorting..
Any ideas or help is really appreciated..
Thanks
__________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] number of digits, Dimitre Novatchev | Thread | RE: [xsl] Fwd: Re: unable to dynami, Michael Kay |
RE: [xsl] Question about xsl-xslt, Chris Bayes | Date | [xsl] RE:, Chris Bayes |
Month |