Click here to Skip to main content
15,897,334 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can we sort the records within this products node based on the index attribute?
Can anyone suggest a stylesheet in xslt?
XML
<?xml version="1.0" encoding="utf-8" ?>
<products>
  <product counter="1" index="10"></product>
  <product counter="1" index="4"></product>
  <product counter="1" index="5"></product>
  <product counter="1" index="1"></product>
  <product counter="1" index="3"></product>
  <product counter="1" index="2"></product>
</products>
Posted
Updated 18-Jan-11 2:31am
v2

1 solution

You can use xsl:sort for that:
Have a look here for more info and an example:
http://www.w3schools.com/xsl/el_sort.asp[^]

Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900