This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to print xml element in asc or desc order

 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

My Code:


This prints the output randomly. How can I control it to print elements in ascending or descending order?

Thanks & best regards
 
Paul Clapham
Sheriff
Pie
Posts: 20771
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would put the data into a suitable collection and sort it in whatever order you need. You have used a collection already, but perhaps you didn't choose the right collection (I don't see where you declare it). And you certainly didn't sort it.
 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Paul Clapham,

Thanks a lot. This has fixed my problem

Best regards
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic