[xsl] sort and grouping on 2 different attributes

Subject: [xsl] sort and grouping on 2 different attributes
From: "Joeri Belis" <joeri.belis@xxxxxxxxxxxx>
Date: Tue, 21 Jan 2003 13:41:45 +0100
I have the following simplified xml

<root>
  <rec A="0" B="1">1</rec>
  <rec A="0" B="3">2</rec>
  <rec A="0" B="3">3</rec>
  <rec A="0" B="3">4</rec>
  <rec A="1" B="1">5</rec>
  <rec A="1" B="1">6</rec>
  <rec A="2" B="1">7</rec>
  <rec A="3" B="1">8</rec>
</root>

each node has 2 attributes ( A and B ). When A="0" then B should be used for
grouping
When A != "0" then A should be used for grouping. Sorting should be done on
A and B
( my simplified example xml is already sorted on A and B)

the result should be than when a group changed i display subtitle

title-1
  <rec A="0" B="1">1</rec>
title-2
  <rec A="0" B="3">2</rec>
  <rec A="0" B="3">3</rec>
  <rec A="0" B="3">4</rec>
title-3
  <rec A="1" B="1">5</rec>
  <rec A="1" B="1">6</rec>
title-4
  <rec A="2" B="1">7</rec>
title-5
  <rec A="3" B="1">8</rec>

I find i hard to find a simple but waterproof solution for grouping on the 2
different attributes.

Joeri



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread