XSLT Grouping for Name Directory

saad911

New Member
I am trying to build a Last Name directory for a project I am working on using XSLT. This is what I want to look like in the end. I want the XSLT to pick up the index grouping for the section search by where it displays the first letter of the person's last name and also, I want it to group by each section in the results based on the person's first letter of their last name. Please see sample below.Search by: A C F G JAAnderson
Andrews
AllisonCCharlesFFredericks
FranksGGarrettJJohnson
JamesI have tried the Muenchian grouping for the section to get the first initial of the person's last name to be under the appropriate letter (ie Section A Anderson, Andrews, Allison....J Johnson James) and that works fine. Using this same code, I tried to apply it to the section to generate Search By A C F G J, where I want to show the first letter of the person's last name based on data from the XML. When tried the code, I didn't get any results back for this section. Can someone please help with this?ThanksCheersUPDATEThe OP wishes to transform this input document ...\[code\]<people> <person><lastname>Johnson</lastname></person> <person><lastname>James</lastname></person> <person><lastname>Charles</lastname></person> <person><lastname>Franks</lastname></person> <person><lastname>Anderson</lastname></person> <person><lastname>Allison</lastname></person> <person><lastname>Fredericks</lastname></person> <person><lastname>Andrews</lastname></person></people>\[/code\]... into the text formatted output document shown above, using XSLT. It is not clear if the OP is using XSLT 1.0 or 2.0. The search letters are provided to the style-sheet as a style-sheet parameter formatted as a space-separated list of uppercase letters, declared like so ...\[code\]<xsl:param name="search-by" select="'A C F G J'" />\[/code\]You can assume that these letters are already sorted alphabetically and are restricted to uppercase.
 
Back
Top