<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
	<xsl:variable name="colspan"> <xsl:value-of select="count(/DBI/RESULTSET/ROW[last()]/*)"/> </xsl:variable>
	<html>
		<body>
			<center>
				<table class="scrollTable" width="auto" cellspacing="0" cellpadding="0"> 
					<tr class="header">
						<th colspan="{$colspan}">
							<table width="auto">
								<tr>
									<th colspan="5"> Table Header </th>
								</tr>
								<tr>
									<th width="5%">+		</th>
									<th width="5%">-		</th>
									<th width="80%">
									<xsl:for-each select="/DBI/perpage/*">
										<xsl:variable name="pp"> <xsl:value-of select="./page"/> </xsl:variable>
										<xsl:variable name="onclick"> <xsl:value-of select="./onclick"/> </xsl:variable>
										<INPUT TYPE="submit" class="menu" value="{$pp}" name="PAGE"  	CLASS="page" onclick="{$onclick}"/>
									</xsl:for-each>
									</th>
									<th width="5%"><input type="text" size="2" class="menu"  id="perpage1"  onkeypress="return numberfilter()"> </input></th>
									<th width="5%"><input type="submit" size="7" class="menu" value="Per Page" onclick=""></input>  </th>
								</tr>
							</table>
						</th>
					</tr>
					<xsl:for-each select="/DBI/RESULTSET/ROW[last()]">
						<tr>
							<xsl:for-each select="*">
								<xsl:if test="name(.) != 'kmownerid'">
									<th class="header" ><xsl:value-of select="name(.)"/>		</th>
								</xsl:if>
							</xsl:for-each>
						</tr>
					</xsl:for-each>
					<xsl:for-each select="/DBI/RESULTSET/ROW">
						<tr>
							<xsl:for-each select="*">
								<xsl:if test="name(.) != 'kmownerid'">
									<td class="header" ><xsl:value-of select="."/>		</td>
								</xsl:if>
							</xsl:for-each>
						</tr>
					</xsl:for-each>
				</table>
			</center>
		</body>
	</html>
</xsl:template>

</xsl:stylesheet>
