Grouping in XSLT using the Muenchian Method

By | 2016-11-18T14:24:39+00:00 January 10th, 2013|Categories: Cascade CMS|Tags: , |

Est. Read Time: ~Less Than a Minute

Have you ever wanted to group lists of information in XSLT? We do know that it’s a common issue in XSLT 1.0. There is a method to help with this called the “Muenchian Method” named after the developer, Steve Muench.

In this example we will cover the standard grouping method that is commonly used. The method involves generating a key and assigning it to “for-each” statements to handle the grouping.

For this particular example we will be grouping a mock address book by “surname” and sorting by “forename”.


First, start with standard flat input from the XML:

Second, create the XSLT template with the key at the top, “for-each” statement with the grouping method applied and the final “for-each” statement that groups the desired element.

Third, the final output would look like this.

The above information was provided by

About the Author:

Zedric Myers
Zedric Myers is a Web Designer for Beacon Technologies. After earning his degree in Advertising and Graphic Design, he spent 11 years with an advertising agency in Greensboro, NC where he was initially hired as a designer and transitioned to being a Web Developer.