Solved

SORT XML

Posted on 2004-04-08
6
290 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
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

 
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

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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

627 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