This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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
Author

Grouping using XSLT 2.0 (question for Dmitry Kirsanov)

sateesh arumbaka
Greenhorn

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.

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

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

http://www.w3.org/TR/xslt20/#grouping-examples

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: http://aspose.com/file-tools
 
subject: Grouping using XSLT 2.0 (question for Dmitry Kirsanov)
 
Similar Threads
XML transformation
subtotal in xslt?
Internal and External DTDs
Is Java Pure Object Oriented?
Group & Sum Using XSLT