This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: To simulate SORT inside a xsl:choose condition


Hello Kumar,

it's not completely correct, what you wrote in your code. It has to be

<xsl:sort  order="ascending"  select="*[name()=$sortmethod]"/>.

This means: Sort all regions in the file by a element ('*'), whose name 
(e.g. 'city') is the same as specified in $sortmethod.

Regards,

Joerg

> I have written XSL to display city, companyname in Table structure .based on the criteria node's sorting i will have to either sort the data by City or Comp_name 
> when it appears for the first time ...
> 
> I tried this ..globally i did 
> <xsl:variable name="sortmethod" select="//criteria/sortby">
> 
> SOmewhere down in my template where i write xsl:for i do this ....
> <xsl:for-each select="//regions">
>       <xsl:sort  order="ascending"  select="name()=$sortmethod"/>
> </xsl:for-each>
> 
> Does that work??
> 
> -kumar


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]