[xsl] looping, moving through elements??

Subject: [xsl] looping, moving through elements??
From: "james walker" <jameswalkerandy@xxxxxxxxxxx>
Date: Thu, 23 Oct 2003 12:46:18 +0100
Ihave this xml (simplified):
<vss>
<ve pos"1">content1</ve>
<ve pos"1.1">content1.1</ve>
<ve pos"1.1.1">content1.1.1</ve>
<ve pos"1.1.1.1">content1.1.1.1</ve>
<ve pos"1.1.2">content1.1.2</ve>
<ve pos"1.1.2.1">content1.1.2.1</ve>
<ve pos"1.1.2.2">content1.1.2.2</ve>
<ve pos"1.2">content1.2</ve>
<ve pos"1.2.1">content1.2.1</ve>
<ve pos"1.2.1.1">content1.2.1.1</ve>
<ve pos"1.2.1.2">content1.2.1.2</ve>
<ve pos"1.2.1.3">content1.2.1.3</ve>
<ve pos"1.2.2">content1.2.2</ve>
<ve pos"1.2.2.1">content1.2.2.1</ve>
<ve pos"1.3">content1.3</ve>
<ve pos"1.3.1">content1.3.1</ve>
<ve pos"1.3.1.1">content1.3.1.1</ve>
<ve pos"2">content2</ve>
<ve pos"2.1">content2.1</ve>
<ve pos"2.1.1">content2.1.1</ve>
<ve pos"2.1.1.1">content2.1.1.1</ve>
</vss>

and i wanted to produce this ouput:
<table>
<tr>
<td>content1</td>
<td>content1.1</td>
<td>content1.1.1</td>
<td>content1.1.1.1</td>
</tr>
<tr>
<td>content1.1.2</td>
<td>>content1.1.2.1</td>
</tr>
<tr>
<td>content1.1.2.2</td>
</tr>
<tr>
<td>content1.2</td>
<td>content1.2.1</td>
<td>content1.2.1.1</td>
</tr>
<tr>
<td>content1.2.1.2</td>
</tr>
<tr>
<td>content1.2.1.3</td>
</tr>
<tr>
<td>content1.2.2</td>
<td>content1.2.2.1</td>
</tr>
<tr>
<td>content1.3</td>
<td>content1.3.1</td>
<td>content1.3.1.1</td>
</tr>
<tr>
<td>content2</td>
<td>content2.1</td>
<td>content2.1.1</td>
<td>content2.1.1.1</td>
</tr>
</table>

but i was having a problem looping through the elements in the such a way that it loops every time an element of "n.n.n.n" is reached. Also i am not sure how to design the templates (i thin this is linke dto the looping)
thanks
james


_________________________________________________________________
Stay in touch with absent friends - get MSN Messenger http://www.msn.co.uk/messenger



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



Current Thread