Solved

SORT XML

Posted on 2004-04-08
6
289 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How  can  i  resolve  HTTP Status 404 -? 8 80
Grunt script for Build Process 1 90
Unexpected End of File 11 87
ArrayList Adding/settign data 3 38
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
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…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

739 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