<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>


<xsl:template name="combo"><xsl:param name="count" select="1"/><xsl:param name="limit"/>
	<xsl:choose>
		<xsl:when test="$count = 1">
			<select style="width: 90px; height: 26px">
				<option>1</option>
				<xsl:if test="$limit &gt; 1">
					<xsl:call-template name="combo"><xsl:with-param name="count" select="$count + 1"/><xsl:with-param name="limit" select="$limit"/></xsl:call-template>
				</xsl:if>
			</select>&#160;/ 
			<xsl:value-of select="@maxpoint"/>
		</xsl:when>
		<xsl:when test="$count &lt; $limit">
 <option>
  <xsl:value-of select="$count"/> 
  </option>
 <xsl:call-template name="combo">
  <xsl:with-param name="count" select="$count + 1"/> 
  <xsl:with-param name="limit" select="$limit"/> 
  </xsl:call-template>
  </xsl:when>
	</xsl:choose>
</xsl:template>

<xsl:template match="/">
	<p>
		<html>
			<body style="background-color: #c0c0c0"/>
		</html>
	</p>
	<font size="5">
		<form action="/TimeReg/SimpleHoroscope" method="post">
			<p align="center">&#160; 
				<strong>Obligatorisk Oppgave: 
					<xsl:value-of select="Assignment/@assignmentnr"/> i 
					<xsl:value-of select="Assignment/@courcecode"/>&#160; 
				</strong>
			</p>
			<input type="hidden" name="Assignmentid"/>
			<p>
				<em>StudentId</em>:&#160;&#160;&#160; &#160; 
				<input size="29" name="navn" style="width: 226px; height: 22px"/>&#160;&#160;&#160;&#160; 
			</p>
			<p>
				<table width="100%" border="1">
					<tbody>
						<xsl:for-each select="Assignment/Criteria">
							<tr>
								<td width="50%">
									<p>
										<xsl:value-of select="@name"/>&#160;&#160;&#160; 
									</p>
								</td>
								<td width="50%">
									<table width="100%" border="1">
										<tbody><xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
											<xsl:for-each select="Point">
												<tr>
													<td width="50%">
														<xsl:value-of select="@name"/>
													</td>
													<td width="50%">
														<p align="center">
															<xsl:call-template name="combo"><xsl:with-param name="limit" select="@maxpoint+1"/></xsl:call-template>
														</p>
													</td>
												</tr>
											</xsl:for-each>
										</tbody>
									</table>
								</td>
							</tr>
						</xsl:for-each>
					</tbody>
				</table>
			</p>
			<p align="center"><textarea></textarea></p>
			<p align="center">
				<table width="267" align="center" border="1" style="; width: 267px; height: 34px">
					<tbody>
						<tr>
							<td width="50%">
								<p align="center">
									<input type="submit" value="Registrer"/>
								</p>
							</td>
							<td width="50%">
								<p align="center">
									<input type="submit" value="Avslutt"/>
								</p>
							</td>
						</tr>
					</tbody>
				</table>
			</p>
		</form>
	</font>
</xsl:template>

</xsl:stylesheet>