Are You the Guy Who Discovered the Muenchian Method of Grouping in XSLT?

Send me a mail
 Dive into Oracle ADF   Click to see the XML version of this web page.   (Updated: 2/3/2008; 9:26:03 PM.)
Tips and tricks from Steve Muench on Oracle ADF Framework and JDeveloper IDE

Are You the Guy Who Discovered the Muenchian Method of Grouping in XSLT?

As my bio explains, I was involved for a while pretty closely with the development of the XSLT 1.0 specification and the requirements for the XSLT 2.0 spec (before having to give up participating due to lack of time). I also wrote a book about getting the most out of Oracle and XML. This was the email that I sent back on May 8th, 2000, to the XSL-List mailing list talking about the "trick" I stumbled across while writing a chapter about XSLT for my book which enabled much faster performance for doing data grouping in XSLT 1.0 stylesheets using the <xsl:key> functionality and exploiting the fact that an XSLT processor always returns a unique id for any node in the source document when using the id() function on that node. Google Book Search finds the section where the technique is originally described in my book here.

Others then dubbed the technique the Muenchian Method -- blush! -- and have written about it in other XSLT books and online.

While a little complicated to wrap your mind around, and fairly verbose to use, it does speed up grouping significantly with XSLT 1.0 processors. The technique should become obsolete in XSLT 2.0 where cool, new grouping features have been added. Here's an article from 2003 that talked about some of them in the version of the XSLT 2.0 spec from back then.

XSLT processor's like Saxon  and the Oracle XSLT processor in the 10g version of the Oracle XDK for Java implement XSLT 2.0 and its grouping features.

© Copyright 2008 Steve Muench. Click here to send an email to the editor of this weblog.
Last update: 2/3/2008; 9:26:03 PM.