xsl-list
[Top] [All Lists]

Grouping question

2003-09-23 16:19:17
Hello all, this is my first post so please be nice. After much googling I ended up here. It's a painful problem that I'm sure someone has solved before but google just doesn't seem to find the answer.

I have an XML structure like this:

<Tracklisting>
   <Track>
      <Disk>1</Disk>
      <Track>1</Track>
      <Title>THE PACKAGE</Title>
   </Track>
   <Track>
      <Disk>1</Disk>
      <Track>2</Track>
      <Title>WEAK AND POWERLESS</Title>
   </Track>
   <Track>
      <Disk>1</Disk>
      <Track>3</Track>
      <Title>THE NOOSE</Title>
   </Track>
   <Track>
       ...
   </Track>
</Tracklisting>

I would like to output a HTML table like this:

<table>
   <tr>
      <td colspan="2">Disk 1</td>
   </tr>
   <tr>
      <td>1. THE PACKAGE</td>
      <td>2. WEAK AND POWERLESS</td>
   </tr>
   <tr>
      <td>3. THE NOOSE</td>*
      *<td></td>
   </tr>
</table>

So basically it is a balanced, two column table, down and across. Is this possible with XSLT? I have experimented with keys but I'm afraid I have even less of an understanding of them now than I did before. I've just gotten confused.

Little help?


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



<Prev in Thread] Current Thread [Next in Thread>