File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Sorting xml string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Sorting xml string" Watch "Sorting xml string" New topic

Sorting xml string

Palani Kumar

Joined: May 28, 2008
Posts: 13
How to sort the xml string.. Please help me... Here is the code... I want to sort the xml string based on num tag...
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

That's Javascript code, isn't it? So your question is how to sort the nodes in Javascript. So let's move this to the forum which is about Javascript.
Palani Kumar

Joined: May 28, 2008
Posts: 13
No here we have to use XSLT . So please move it to xml .
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
here we have to use XSLT

Why? Is the objective to sort the XML data, or to do so using a particular technique?
Palani Kumar

Joined: May 28, 2008
Posts: 13
You can use any technology. But actually original xml string is too big. So I cant use array concept here. So I thought its better to use XSLT. Any of your suggestion is welcome.
K West
Ranch Hand

Joined: Sep 10, 2008
Posts: 58

Whats the task.
I mean if you want to do so you by two ways:

If you are getting the xml from some query you can get it ordered by already from there.
Second thing is if you want to display that data sorted by num in table you can use jGrid by jQuery.

But still if you want to sort it in javascript it can be done but would be more complex.

Years teach us more than books.
I agree. Here's the link:
subject: Sorting xml string
It's not a secret anymore!