<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html" encoding="ISO-8859-1" indent="yes"/>
	<xsl:key name="DRAW_DATE" match="data/record" use="DRAW_DATE"/>
	<xsl:template match="/">
		<body>
			<table class="cpltable">
				<tbody>
					<tr class="trcolheader">
						<td width="10%"/>
						<td class="cpltablecol" width="20%">Protocol</td>
						<td class="cpltablecol" width="30%">No./Species</td>
						<td class="cpltablecol" width="40%">Special Requirements</td>
					</tr>
					<xsl:for-each select="data/record[generate-id()=generate-id(key('DRAW_DATE',DRAW_DATE)[1])]">
						<tr>
							<td class="normalheading" colSpan="4">
								<xsl:value-of select="DRAW_DATE"/>
							</td>
						</tr>
						<tr>
							<td class="cpltablecol" colSpan="4">
								<xsl:choose>
									<xsl:when test="((substring-before(TIME_OF_DELIVERY, ':')>04) and contains(TIME_OF_DELIVERY, 'PM'))">
									Icon  <xsl:value-of select="TIME_OF_DELIVERY"/>
									</xsl:when>
									<xsl:otherwise>
										<xsl:value-of select="TIME_OF_DELIVERY"/>
									</xsl:otherwise>
								</xsl:choose>
							</td>
						</tr>
						<tr>
							<td colSpan="4">
								<table>
									<tbody>
										<xsl:for-each select="key('DRAW_DATE',DRAW_DATE)">
											<tr>
												<td class="cpltablecol" width="10%">
													<input>
														<xsl:attribute name="TYPE">checkbox</xsl:attribute>
														<xsl:attribute name="name">print_<xsl:value-of select="SCHEDULE_ID"/></xsl:attribute>
														<xsl:attribute name="value"><xsl:value-of select="SCHEDULE_ID"/></xsl:attribute>
													</input>
													
													</td>
												<td class="cpltablecol" width="20%">
												      <xsl:if test="((CPL_ASSISTANCE='y') or(CPL_ASSISTANCE='Y'))">
														<xsl:text>Icon </xsl:text>  
													</xsl:if>
													
													<xsl:value-of select="PROTOCOL_NUMBER"/>
												</td>
												<td class="cpltablecol" width="30%">
													<xsl:value-of select="SPECIES"/>
												</td>
												<td class="cpltablecol" width="40%">
													<xsl:choose>
														<xsl:when test="contains(SPECIAL_REQUIREMENTS, 'null')">
														</xsl:when>
														<xsl:otherwise>
															<xsl:value-of select="SPECIAL_REQUIREMENTS"/>
														</xsl:otherwise>
													</xsl:choose>
												</td>
											</tr>
										</xsl:for-each>
									</tbody>
								</table>
							</td>
						</tr>
					</xsl:for-each>
				</tbody>
			</table>
		</body>
	</xsl:template>
</xsl:stylesheet>
<!-- Stylus Studio meta-information - (c) 2004-2005. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="Scenario1" userelativepaths="yes" externalpreview="no" url="..\..\..\..\..\..\..\Untitled1.xml" htmlbaseurl="" outputurl="" processortype="internal" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no" ><SourceSchema srcSchemaPath="..\..\..\..\..\..\..\Untitled1.xml" srcSchemaRoot="data" AssociatedInstance="" loaderFunction="document" loaderFunctionUsesURI="no"/></MapperInfo><MapperBlockPosition><template match="/"><block path="body/table[1]/tbody/xsl:for&#x2D;each" x="177" y="288"/><block path="body/table[1]/tbody/xsl:for&#x2D;each/tr/td/xsl:value&#x2D;of" x="217" y="304"/><block path="body/table[1]/tbody/xsl:for&#x2D;each/tr[1]/td/xsl:value&#x2D;of" x="177" y="352"/><block path="body/table[1]/tbody/xsl:for&#x2D;each/tr[2]/td/table/tbody/xsl:for&#x2D;each" x="177" y="210"/><block path="body/table[1]/tbody/xsl:for&#x2D;each/tr[2]/td/table/tbody/xsl:for&#x2D;each/tr/td/input/xsl:attribute[2]/xsl:value&#x2D;of" x="177" y="170"/><block path="body/table[1]/tbody/xsl:for&#x2D;each/tr[2]/td/table/tbody/xsl:for&#x2D;each/tr/td/input/xsl:attribute[3]/xsl:value&#x2D;of" x="217" y="170"/><block path="body/table[1]/tbody/xsl:for&#x2D;each/tr[2]/td/table/tbody/xsl:for&#x2D;each/tr/td[1]/xsl:value&#x2D;of" x="217" y="210"/><block path="body/table[1]/tbody/xsl:for&#x2D;each/tr[2]/td/table/tbody/xsl:for&#x2D;each/tr/td[2]/xsl:value&#x2D;of" x="137" y="210"/><block path="body/table[1]/tbody/xsl:for&#x2D;each/tr[2]/td/table/tbody/xsl:for&#x2D;each/tr/td[3]/xsl:if" x="27" y="180"/><block path="body/table[1]/tbody/xsl:for&#x2D;each/tr[2]/td/table/tbody/xsl:for&#x2D;each/tr/td[3]/xsl:if/xsl:value&#x2D;of" x="97" y="210"/></template></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->
