This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sorting xml

 
Tom John
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
<list>
<employee>name</employee>
<department>dept</department>
</list>
you get the idea, got any ideas for me?
thanks
 
Zoe Peng
Ranch Hand
Posts: 112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Zoe, that worked great. It was much simpler than I had thought it would be.
Thanks again.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic