PANVEGA’s Blog

DotNet Development, SharePoint Customizing, Silverlight, MS Infrastructure and other tips and tricks

Posts Tagged ‘xsl’

Easy Grouping in XSLT 1.0

Posted by PANVEGA on June 10, 2009

I was asked to implement a grouping by TEAM with all the employees regarding to the Team Name into a SharePoint People Results Webpart. Here I am gonna show you a very nice aproach how to realize this custom request.

I read in so many posts how to create a proper grouping results in XSLT 1.0. XSLT 2.0 makes grouping even easier than Steve did. The XSLT 2.0 xsl:for-each-group instruction iterates across a series of groups, with the criteria for grouping specified by its attributes.  While XSLT 1.0 lets you sort elements, it still forces you to jump through several hoops to do anything extra with the groups that result from the sort.

Here is a snipped of the XML file:

<?xml version="1.0" ?>
<All_Results>
 <Result>
  <Team>BI</Team>
  <PreferedName>Alex</PreferedName>
  <Function>1</Function> 
 </Result> 
<Result>
  <Team>BI</Team>
  <PreferedName>Max</PreferedName>
  <Function>3</Function>
 </Result> 
<Result>
  <Team>BDEV</Team>
  <PreferedName>Moritz</PreferedName>
  <Function>1</Function>
 </Result>
</All_Results>
 Read the rest of this entry »

Posted in MOSS, WebParts, XSLT | Tagged: , , | Leave a Comment »