BizTalk Utilities CV ,   Jobs ,   Code library
 
Home Page


Add/Edit your code items
Search the code library
Browse for the code library


XSLT
Dependent ComboBox in HTML build with XSLT
Re: How to use XSL function sum() to sum 2 XML fields
Re: How to use XSL function sum() to sum 2 XML fields
How to use XSL function sum() to sum 2 XML fields
A simple template to display singular and plural counts
Helpful XSLT ""break"" template
Support automatic transformation using XSLT in IE in side by side mode
Displaying XML data in Pages
Repeated search and replace in XSLT
Combinations of k out of n numbers
Permutations of the values of N nodes
DVC Algorithms in XSLT
Another way of avoiding XSLT processor crash
Re: DVC Algorithms in XSLT
trig functions in xslt
XSLT string Replace function
A Slide-In Menu made with XML/XSLT
What is SVG?
Family Tree maker
Alternative Ordering - ""Women and Children to the lifeboats first""


 
 

<< XQuery.NET and XML >>


By Jason Bauer
First Posted 08/08/2001
Times viewed 1604

Grouping an XML Node by First Letter


Summary This XSL code is a simple example that allows you to group a list of nodes by first letter (or any letter for that matter). Useful for breaking up long lists by adding an alphabet to the top with links to each letter.

Simply add this <xsl:for-each> loop to you code and change the select attribute to group your nodes by their first letter. This will create a list with an anchor and group name between each letter of the alphabet. Below is what this will look like:

3

3Com Corporation
3M Company

Back to Top

A

A.K. Steel Holding Corp
A.M.P. Inc
A.O. Smith Corp
A.O.N. Corp

Additional information


Rate this article on a scale of 1 to 10 (3 votes, average 5)

Your vote :  

<< XQuery.NET and XML >>





Leave a comment for this article
Your name
Your email (optional)
Your comment
Optional: Upload an attachment
Enter the code shown:

 
 

    Email TopXML