Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SORT XML

Posted on 2004-04-08
6
Medium Priority
?
294 Views
Last Modified: 2013-11-19
Hi Experts,

I have JSP getting XML based on criteria and then parsing it via XSLT.
Is there way to presort by some attribute this XML before parsing it ?

If yes how would it be done and give me some simple example.


Thank you.
0
Comment
Question by:fpoyavo
  • 3
  • 2
6 Comments
 
LVL 7

Expert Comment

by:searlas
ID: 10783919
Have you looked at the XSLT sort element xsl:sort?

http://www.devguru.com/Technologies/xslt/quickref/xslt_element_sort.html
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10784209
I need to sort it permanently and keep this way before parsing it because I use paging.
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10784222
It means to get XML then sort it and save sorted in some directory and only then use it.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 7

Expert Comment

by:searlas
ID: 10784425
Is this your situation?

1) Batch process XML files to sort, and save sorted files
...time passes...
2) JSP processes pre-sorted XML with XSLT to output (what?  HTML?)


If so, why not:
1) Batch process XML using XSLT to sort and output sorted XML to file.
2) as before...
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10784486
The problem is that I use paging and sort does not help for the whole result set. So I need to get this XML sorted and kept
in some temp dir and then use it for display using another XSLT.

May be there is a better way ?

Thank you.
0
 
LVL 19

Accepted Solution

by:
Kuldeepchaturvedi earned 2000 total points
ID: 10785469
If I get it right then you are converting your resultset to XML....
If that the case why don't you query the database with a Order By clause??? It will return the data in sorted order and hence your XML will automatically a sorted one...
there will be no need to put it in a temp directory as well....
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question