It's not a secret anymore!
The moose likes XML and Related Technologies and the fly likes Grouping using XSLT 2.0  (question for Dmitry Kirsanov) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Grouping using XSLT 2.0  (question for Dmitry Kirsanov)" Watch "Grouping using XSLT 2.0  (question for Dmitry Kirsanov)" New topic

Grouping using XSLT 2.0 (question for Dmitry Kirsanov)

sateesh arumbaka

Joined: Nov 22, 2002
Posts: 6
I tried grouping with XSLT but couldnt get it to work,

I heard that XSLT 2.0 has some special functions/support for grouping.
Can you please explain this with an example.

[ July 15, 2004: Message edited by: sateesh arumbaka ]
Dmitry Kirsanov
Ranch Hand

Joined: Apr 26, 2004
Posts: 33
The definitive (but easy to understand) grouping examples are right here:

Basically, the grouping feature may be called "for-each on steroids". The new instruction, for-each-group, works similar to for-each, but on each iteration it gives you a group of nodes instead of a single node. This group, accessed by current-group() in XPath, can be further sorted, filtered, transformed, etc. The best thing about that is that the groups may be selected based on a wide variety of tests, such as common value, adjacency, starting/ending node etc.
I agree. Here's the link:
subject: Grouping using XSLT 2.0 (question for Dmitry Kirsanov)
jQuery in Action, 3rd edition