xsl-list
[Top] [All Lists]

Re: Could I set an attribute to <xsl:sort> ?

2003-06-05 00:13:22
On Wednesday 04 June 2003 20:22, Oleg Tkachenko wrote:
Martin Grigorov wrote:
<xsl:sort select="/some/where" order="{$ord}"/>

I have already try it - it doesn't work.

Elaborate please what do you mean by saying "it doesn't work": you've got
some error or sorting doesn't work etc.
Actually select="/some/where" in your example looks weird. I understand
that's just sample, but having absolute location path in select attribute
really doesn't make sense, because it doesn't depend on context hence
always evaluates to the same string value.

I have this:

In the beginning of my xslt file:
<xsl:stylesheet version="1.0" >
...... 
<xsl:param name="ord"/>
...... some other params ......
..... functional part .....
---------------------------

<xsl:for-each select="/first/second">
<xsl:sort select="third/fourth" order="{$ord}" />
.....
</xsl:for-each>

When I print it to debug with <xsl:value-of select="$ord" /> it returns 
one of 'ascending' or 'descending', but it always sort ascending ( which is 
the default value ). I think that my param $ord has no sense.

OS: FreeBSD
XSLT processor: LibXSLT for Perl ( interface to the gnome libxslt library )

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