BrandonPar
Programmer
Hi,
I'm trying to look at a list of dates and if one of those dates is in january then produce an output. The problem i have is that i don't want to produce the output twice even if there are dates in January listed more than once.
The following XML produces Y twice in the January column
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="island.xsl"?>
<xmldata>
<workactivity>
<text>Absence</text>
<question>
<text>A Review Appointment must be made for Jarvis Cocker on 03/10/2001</text>
<date>
<day>01</day>
<month>01</month>
<year>1999</year>
</date>
<date>
<day>11</day>
<month>01</month>
<year>1999</year>
</date>
<date>
<day>11</day>
<month>02</month>
<year>1999</year>
</date>
</question>
<question>
<text>My second question</text>
<date>
<day>21</day>
<month>11</month>
<year>1999</year>
</date>
<date>
<day>07</day>
<month>07</month>
<year>2000</year>
</date>
</question>
</workactivity>
</xmldata>
Here is the stylesheet
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- <xsl:stylesheet xmlns:xsl=" -->
<xsl:stylesheet version="1.0" xmlns:xsl="
<xsl:template match="/">
<html>
<body>
<table border="2" bgcolor="yellow">
<tr>
<th>Question</th>
<th>J</th>
</tr>
<xsl:for-each select="xmldata/workactivity/question">
<tr>
<td><xsl:value-of select="text"/></td>
<td>
<xsl:for-each select="date">
<xsl:if test="month='01'">
Y
</xsl:if>
</xsl:for-each>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
If anybody can give me some pointers i would be very grateful.
Kind Regards,
Brandon Par
I'm trying to look at a list of dates and if one of those dates is in january then produce an output. The problem i have is that i don't want to produce the output twice even if there are dates in January listed more than once.
The following XML produces Y twice in the January column
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="island.xsl"?>
<xmldata>
<workactivity>
<text>Absence</text>
<question>
<text>A Review Appointment must be made for Jarvis Cocker on 03/10/2001</text>
<date>
<day>01</day>
<month>01</month>
<year>1999</year>
</date>
<date>
<day>11</day>
<month>01</month>
<year>1999</year>
</date>
<date>
<day>11</day>
<month>02</month>
<year>1999</year>
</date>
</question>
<question>
<text>My second question</text>
<date>
<day>21</day>
<month>11</month>
<year>1999</year>
</date>
<date>
<day>07</day>
<month>07</month>
<year>2000</year>
</date>
</question>
</workactivity>
</xmldata>
Here is the stylesheet
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- <xsl:stylesheet xmlns:xsl=" -->
<xsl:stylesheet version="1.0" xmlns:xsl="
<xsl:template match="/">
<html>
<body>
<table border="2" bgcolor="yellow">
<tr>
<th>Question</th>
<th>J</th>
</tr>
<xsl:for-each select="xmldata/workactivity/question">
<tr>
<td><xsl:value-of select="text"/></td>
<td>
<xsl:for-each select="date">
<xsl:if test="month='01'">
Y
</xsl:if>
</xsl:for-each>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
If anybody can give me some pointers i would be very grateful.
Kind Regards,
Brandon Par