[xsl] how to convert from list to grid ?

Subject: [xsl] how to convert from list to grid ?
From: "Bru, Pierre" <Pierre.Bru@xxxxxxxxxxxx>
Date: Sun, 30 Oct 2005 23:48:04 +0100

I've been racking my brains for a couple of weeks now but I can not find
a way to do the folowing: I have a list reprenting the type and integer
coordinate of various items on a square grid like this one:

  <item id="1" type="foo" x="1" y="7" />
  <item id="2" type="bar" x="8" y="2" />
  <item id="3" type="foo" x="8" y="2" />
  <item id="4" type="bar" x="8" y="3" />
  <item id="5" type="bar" x="8" y="3" />
  <item id="6" type="bar" x="8" y="3" />

- "id" are unique
- each cell may contain any number of item (including 0).
- there are as many lines as needed for each cell (see [8,2] or [8,3])
- the cell are in no particular order for now but this can be changed as

I would like to transform this list into a square grid (table?) with :
- if the cell contains no item, an empry cell
- otherwise, the count of item(s) of each type (one value for each type
present on the cell)

is this feasable with XSLT ?


Current Thread