How Do I Group Elements in an XML Document?

Unlike sorting, grouping is not directly supported in XSLT. Most axes and functions you’d like to use for grouping work only with the document order of the XML document, not with the sorted order you’d need for grouping. That being said, you can use some tricks to group elements in your output document. This subject is discussed in great detail in Section 6.2 in Chapter 6.

Get XSLT now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.