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]

sorting with param @attribute


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


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