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

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                xmlns:rx="http://www.renderx.com/XSL/Extensions"
                version="1.0">	
<xsl:template match="/">
		<html>
			<head/>
			<body>
				<xsl:for-each select="ROWSET">
					<xsl:for-each select="ROW">
						<xsl:if test="position()=1">
							<xsl:text disable-output-escaping="yes">&lt;table border="1"&gt;</xsl:text>
						</xsl:if>
						<xsl:if test="position()=1">
							<thead>
								<tr>
									<td>EMPNO</td>
									<td>ENAME</td>
									<td>DEPTNO</td>
									<td>SAL</td>
									<td>HRA</td>
								</tr>
							</thead>
						</xsl:if>
						<xsl:if test="position()=1">
							<xsl:text disable-output-escaping="yes">&lt;tbody&gt;</xsl:text>
						</xsl:if>
						<tr>
							<td>
								<xsl:for-each select="EMPNO">
									<xsl:apply-templates/>
								</xsl:for-each>
							</td>
							<td>
								<xsl:for-each select="ENAME">
									<xsl:apply-templates/>
								</xsl:for-each>
							</td>
							<td>
								<xsl:for-each select="DEPTNO">
									<xsl:apply-templates/>
								</xsl:for-each>
							</td>
							<td>
								<xsl:for-each select="SAL">
									<xsl:apply-templates/>
								</xsl:for-each>
							</td>
							<td>
								<xsl:for-each select="HRA">
									<xsl:apply-templates/>
								</xsl:for-each>
							</td>
						</tr>
						<xsl:if test="position()=last()">
							<xsl:text disable-output-escaping="yes">&lt;/tbody&gt;</xsl:text>
						</xsl:if>
						<xsl:if test="position()=last()">
							<xsl:text disable-output-escaping="yes">&lt;/table&gt;</xsl:text>
						</xsl:if>
					</xsl:for-each>
				</xsl:for-each>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>


