Nested Grouping problem

Subject: Nested Grouping problem
From: "Alex Aguilar" <alex@xxxxxxxxxxxx>
Date: Wed, 29 Nov 2000 02:07:58 -0800
This is a grouping problem. In fact its a nested grouping problem.

I've gone through your Jennison's helpful article on the Muenchian key
technique and searched through the newsgroup messages and the XSLT FAQ but
haven't found anything similar.

>From a flat XML structure like:

<Fund rowid="1">
    <fundName>Sarah's MoneyMarket Fund</fundName>
<Fund rowid="2">
    <fundName>Will's Fund</fundName>
    <allocCategory>Domestic Equity</allocCategory>
    <capitalization>Small Cap</capitalization>
<Fund rowid="6">
    <fundName>Alex's Fund</fundName>
    <allocCategory>Domestic Equity</allocCategory>
    <assetClass>Aggressive Growth</assetClass>
    <capitalization>Medium Cap</capitalization>

I want to create a nice looking page that looks like this.   I used to have
it working in XSL but then we found out there wasn't an easy way to get the
database to return a nice hierarchical XML like the one I had designed ;-(

My problem is I'm relatively new to XSL and am not sure as to the best way
to go about creating keys to accommodate four levels of nested grouping. As
I stated XML cannot be modified. It has to be processed in this flat format.
I'm able to get up to one level but once I start nesting for-each loops
inside each other I don't get the desired results.

I was thinking of perhaps hardcoding the four top level categories (Cash,
Domestic Fixed, Domestic Equity and International Equity). The only thing I
don't like about that is that if ever another allocation category were added
then someone has to make a change to the XSL.  Is there a way to perhaps a
make a robust XSL so that no matter how many categories are added the XSL
would still handle it?

To be honest, I'm kind of tired of spinning my wheels on this one and am
willing to monetarily compensate someone to help me solve this one.

Here are some reference files:

  FundList.xml - file containing the current flat XML structure
  FundList.xsl - my feeble attempt
  FundList.xls - an Excel file outlining the category structure

If anyone is interested in my offer, please contact me off the list at

Alex Aguilar

 XSL-List info and archive:

Current Thread