ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> xsl-list
xsl-list
[xsl] xsl sort: using element attribute as sort key!
by Adam J Knight other posts by this author
Apr 17 2005 5:31PM messages near this date
Re: [xsl] Measuring the complexity of XSLT stylesheets | Re: [xsl] xsl:number question (XSLT 1.0)
& XSLT Hi all, 

I am trying to sort based on an elements attribute. Doesn't seem to work.
Can i do this, and if so, what am i doing wrong? 
Replies greatly appreciated!

$sort parameter = 'name'
$dir parameter = 'descending'

xml structure:
<dfile> 
  <df_data_row> 
    <df_data column='name'> Value</df_data>
  </df_data_row> 
  <df_data_row> 
    <df_data column='phone'> Value2</df_data>
  </df_data_row> 
</dfile> 

<xsl:if test="$sort"> 
  <xsl:apply-templates select="dfile/df_data_row"> 
    <xsl:sort select="df_data/@column = $sort" order="$dir"> </xsl:sort>
  </xsl:apply-templates>   
</xsl:if> 

Cheers, 
Adam 
 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@[...].com> 
--~--

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved