Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - sort by Variable >Thread Next - Re: sort by Variable Re: sort by VariableTo: NULL Date: 10/9/2006 9:38:00 AM
First, you need to learn how to use Templates. A Template is similar to a
function, but it is applied using either a match expression or a name.
Templates are generally better to use than for-each elements, in the same
way that functions are generally better to use than looping statements. To
sort, you can use a Template or a for-each element.
I would start by getting rid of the nested for-each elements in your markup:
<xsl:tamplate match="/">
<xsl:apply-templates select="root/my_node/my_node_parallel >
<xsl:sort select="format-number($totale_finale,'#.##')" />
</xsl:apply-templates>
</xsl:template>
<xsl:template match="my_node_parallel">
<!-- This template is already sorted. Add whatever you need here -->
</xsl:template>
--
HTH,
Kevin Spencer
Microsoft MVP
Computer Control Freak
http://unclechutney.blogspot.com
A man, a plan, a canal, a palindrome that has.. oh, never mind.
"Ghena" <lastminutesud@g...> wrote in message
news:1160388071.826240.290980@k......
>I have just this situation :
>
>
> <xsl:template match="/">
> <xsl:for-each select="/root" >
> <xsl:for-each select="my_node" >
> <xsl:for-each select="my_node_parallel" >
>
> <!--I Create Variable and calculate value for totale_finale--> <--!I
> need to order using totale_finale value -->
>
> <xsl:value-of select="format-number($totale_finale,'#.##')" />
>
> </xsl:for-each>
> </xsl:for-each>
> </xsl:for-each>
>
> </xsl:template>
>
>
> How can I do node-set able to sorting this kind of template ?
>
> Thanks in advance.
> Regards.
>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
