Ok I have the following XSL style sheet that works fine. The only problem is it's far too slow.
========================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- <xsl:stylesheet xmlns:xsl=" -->
<xsl:stylesheet version="1.0" xmlns:xsl="<xsl:template match="/">
<table class="Dtable" border="0" cellspacing="0" cellpadding="3" width="100%">
<thead>
<th>Work Activity</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '02')
</xsl:attribute>
F
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '03')
</xsl:attribute>
M
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '04')
</xsl:attribute>
A
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '05')
</xsl:attribute>
M
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '06')
</xsl:attribute>
J
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '07')
</xsl:attribute>
J
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '08')
</xsl:attribute>
A
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '09')
</xsl:attribute>
S
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '10')
</xsl:attribute>
O
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '11')
</xsl:attribute>
N
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '12')
</xsl:attribute>
D
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2003' , '01')
</xsl:attribute>
J
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2003' , '02')
</xsl:attribute>
F
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2003' , '03')
</xsl:attribute>
M
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2003' , '04')
</xsl:attribute>
A
</xsl:element>
</th>
</thead>
<xsl:for-each select="xmldata/workactivity">
<tr>
<td>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('yearlybyquestion.xsl','<xsl:value-of select="text"/>')
</xsl:attribute>
<xsl:value-of select="text"/>
</xsl:element>
</td>
<td class="before">
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
<xsl:for-each select="question/date[month='02' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="before">
<xsl:for-each select="question/date[month='03' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="before">
<xsl:for-each select="question/date[month='04' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="now">
<xsl:for-each select="question/date[month='05' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='06' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='07' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='08' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='09' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='10' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='11' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='12' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='01' and year='2003']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='02' and year='2003']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='03' and year='2003']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='04' and year='2003']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
==========================================================
Any suggestions on how to speed this up would be gratefully accepted.
Ben
========================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- <xsl:stylesheet xmlns:xsl=" -->
<xsl:stylesheet version="1.0" xmlns:xsl="<xsl:template match="/">
<table class="Dtable" border="0" cellspacing="0" cellpadding="3" width="100%">
<thead>
<th>Work Activity</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '02')
</xsl:attribute>
F
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '03')
</xsl:attribute>
M
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '04')
</xsl:attribute>
A
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '05')
</xsl:attribute>
M
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '06')
</xsl:attribute>
J
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '07')
</xsl:attribute>
J
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '08')
</xsl:attribute>
A
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '09')
</xsl:attribute>
S
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '10')
</xsl:attribute>
O
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '11')
</xsl:attribute>
N
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2002' , '12')
</xsl:attribute>
D
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2003' , '01')
</xsl:attribute>
J
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2003' , '02')
</xsl:attribute>
F
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2003' , '03')
</xsl:attribute>
M
</xsl:element>
</th>
<th>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('monthlybyworkactivity.xsl', '2003' , '04')
</xsl:attribute>
A
</xsl:element>
</th>
</thead>
<xsl:for-each select="xmldata/workactivity">
<tr>
<td>
<xsl:element name="a">
<xsl:attribute name="href">
javascript:switchView('yearlybyquestion.xsl','<xsl:value-of select="text"/>')
</xsl:attribute>
<xsl:value-of select="text"/>
</xsl:element>
</td>
<td class="before">
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
<xsl:for-each select="question/date[month='02' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="before">
<xsl:for-each select="question/date[month='03' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="before">
<xsl:for-each select="question/date[month='04' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="now">
<xsl:for-each select="question/date[month='05' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='06' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='07' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='08' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='09' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='10' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='11' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='12' and year='2002']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='01' and year='2003']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='02' and year='2003']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='03' and year='2003']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
<td class="after">
<xsl:for-each select="question/date[month='04' and year='2003']">
<xsl:if test="position()=1">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="status"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="responsible"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
<img src="/icons/ecblank.gif" border="0" alt="" width="1" height="1" />
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
==========================================================
Any suggestions on how to speed this up would be gratefully accepted.
Ben