File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes sorting xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "sorting xml" Watch "sorting xml" New topic

sorting xml

Tom John

Joined: Jun 29, 2001
Posts: 10
Howdy ranchers,
I have an xml and I already have an xsl to generate html. I want to sort this xml and still use my existing xsl to generate html. So I'm wondering, can I do a sort within a DOM? Or do I need to do a seperate xsl?
my existing xml is pretty basic, something like this
you get the idea, got any ideas for me?
Zoe Peng
Ranch Hand

Joined: Nov 27, 2000
Posts: 112
<xsl:for-each select="list" >
<xsl:sort select="list/employee" order="decending" />
</xsl:for each>
make sure what's ur key is..then ..should work fine..
Tom John

Joined: Jun 29, 2001
Posts: 10
Thanks Zoe, that worked great. It was much simpler than I had thought it would be.
Thanks again.
I agree. Here's the link:
subject: sorting xml
It's not a secret anymore!