Sorting a list

I’m trying to sort a list but i’m having problems.

I have a XSLT file that creates a table…this is its code:

<xsl:call-template name=“get_position”>
<xsl:with-param name=“param1” select="$param1"/>

So, I have another XSLT file that has the template “get_position” and this is its code:

<xsl:template name=“get_position”>
<xsl:param name=“param1”/>
<xsl:for-each select="/test/[ParamID=$param1]/positions">

<xsl:value-of select="($param1)/@position"/>


What I have to do to sort the values depending of the position…??


Hello there,

You can sort members of an iteration using xsl:sort tag.

eg :

<xsl:for-each select="/test/[ParamID=$param1]/positions">
<xsl:sort select="." type=“number” />


However, it seems that you want to sort data of the parameter ($param1), but you don’t iterate over $param1.

You might need to refactor your XSL in order to perform a sort.


Bertrand Martel
Software AG France


Do you have a small sample input file?



Ok, maybe I did not put the correct code, so what I wanted to explain was that how can I sort the list of values if these values were created in the other file.

So, I need an example of how to sort a list using xls:call-template ???

Thanks again!


Thanks for everybody, I could fix my problem, I could sort my list…!!!