[xsl] sorting with param @attribute

Subject: [xsl] sorting with param @attribute
From: "Ilyasov Jienbay" <jienbay@xxxxxxxxxxx>
Date: Sat, 19 Jan 2002 16:41:32 +0000
hi,
given
<items>
<item id="1">
 <title>4</title>
 </item>
<item id="2">
 <title>3</title>
 </item>
<items>
i pass param <titile> and sort with
<xsl:param name="sort"/>
<xsl:for-each select="//item">
<xsl:sort select="*[name()=$sort]" />
<table>
<tr>
<td><xsl:value-of select="@id" /></td>
<td><xsl:value-of select="title" /></td>
<tr>
</table>
what i get is

<tr>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>1</td>
<td>4</td>
</tr>

now with the same way passed param @id how can i have it sorted by @id and get

<tr>
<td>1</td>
<td>4</td>
</tr>
<tr>
<td>2</td>
<td>3</td>
</tr>

thank you
jian

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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



Current Thread