aspose file tools
The moose likes XML and Related Technologies and the fly likes How to print xml element in asc or desc order Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "How to print xml element in asc or desc order" Watch "How to print xml element in asc or desc order" New topic
Author

How to print xml element in asc or desc order

Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 672
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
Bartender

Joined: Oct 14, 2005
Posts: 16479
    
    2

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

Joined: Mar 22, 2008
Posts: 672
Dear Paul Clapham,

Thanks a lot. This has fixed my problem

Best regards
 
I agree. Here's the link: http://zeroturnaround.com/jrebel/download
 
subject: How to print xml element in asc or desc order
 
Similar Threads
java.lang.NullPointerException
parsing XML in java
help with web service to display xml file contents using netbeans
Parsing Nested XML Nodes
Reading Nested XML attributes