Nu har jag provat lite och har nästan löst det..
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<table cellpadding="0" cellspacing="0" style="width: 100%; border: 1px #333 solid;">
<xsl:apply-templates select="feed"/>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="feed">
<xsl:for-each select="tournament">
<thead>
<tr>
<th bgcolor="#cc0000" align="left" colspan="6"><span style="color: #fff;"><xsl:value-of select="@name"/></span></th>
</tr>
<tr>
<th align="left">Time</th>
<th align="left" colspan="2">Match</th>
<th align="left">Home</th>
<th align="left">Draw</th>
<th align="left">Away</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="match">
<tr class="GridRow_Default">
<td><xsl:value-of select="@startdate"/></td>
<xsl:for-each select="participants">
<td><xsl:value-of select="participant"/></td>
</xsl:for-each>
<xsl:for-each select="odds">
<td><xsl:value-of select="outcome"/></td>
</xsl:for-each>
</tr>
</xsl:for-each>
</tbody>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Det ger följande kod:
<table cellspacing="0" cellpadding="0" style="border: 1px solid rgb(51, 51, 51); width: 100%;">
<thead>
<tr>
<th bgcolor="#cc0000" align="left" colspan="6"><span style="color: rgb(255, 255, 255);">Friendly Club Matches 2009</span></th>
</tr>
<tr>
<th align="left">Time</th>
<th align="left" colspan="2">Match</th>
<th align="left">Home</th>
<th align="left">Draw</th>
<th align="left">Away</th>
</tr>
</thead>
<tbody>
<tr class="GridRow_Default">
<td>2009-08-14 20:00:00</td>
<td>Sevilla FC</td>
<td>2.40</td>
</tr>
<tr class="GridRow_Default">
<td>2009-08-15 20:00:00</td>
<td>Real Sociedad</td>
<td>6.60</td>
</tr>
</tbody>
</table>
Av någon skum anledning skrivs bara ett lag (participant) och ett odds (outcome) ut.
Varför? Bör inte loopen köras igenom "varje varv"?
