<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"></xsl:output>
<xsl:template match="/">
	<html>
		<head>
			<title>XML Tree Control</title>
			<link rel="stylesheet" type="text/css" href="/Reports/MenuTree/xmlTree.css"/>
			<script type="text/javascript" src="/Reports/MenuTree/xmlTree.js"></script>
		</head>
		<xsl:apply-templates/>
	</html>
</xsl:template>
<xsl:template match="tree">
	<body>
		<xsl:apply-templates/>
	</body>
</xsl:template>
<xsl:template match="branch">
	<span class="trigger">
		<xsl:attribute name="onclick">showBranch('<xsl:value-of select="@id"/>','<xsl:value-of select="@value"/>');</xsl:attribute>
		<xsl:attribute name="onkeyup">showBranch('<xsl:value-of select="@id"/>','<xsl:value-of select="@value"/>');</xsl:attribute>	 
		<!-- <xsl:attribute name="onclick">alert('<xsl:value-of select="@id"/>');</xsl:attribute> -->
		<img src="/Images/Lplus.gif"><xsl:attribute name="id">I<xsl:value-of select="@id"/></xsl:attribute></img>
		<!--<input type="text" onkeypress="KeypressEnter();" style="background-color:#ffefd5;border-style:None"><xsl:attribute name="value"><xsl:value-of select="branchText"/></xsl:attribute></input>-->
		<input type="text" readonly="true" size ="80" maxLength="80" style="background-color:#ffefd5;border-style:None"><xsl:attribute name="value"><xsl:value-of select="branchText"/></xsl:attribute></input>
		<br/>
	</span>
	<span class="branch">
		<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
		<xsl:apply-templates/>
	</span>
</xsl:template>
<xsl:template match="leaf">
	<img src="/Images/L.gif"/>
	<a class="triggerleaf">
<!-- Temp Code Commented By RPR  For Testing Purpose -->
 	<xsl:attribute name="ondblclick">select('<xsl:value-of select="link"/>','<xsl:value-of select="Param"/>');</xsl:attribute>
	<xsl:attribute name="onkeydown">select('<xsl:value-of select="link"/>','<xsl:value-of select="Param"/>');</xsl:attribute>
	<xsl:attribute name="onkeypress">select('<xsl:value-of select="link"/>','<xsl:value-of select="Param"/>');</xsl:attribute> 
	
<!--	<xsl:attribute name="ondblclick">alert('<xsl:value-of select="link"/>');</xsl:attribute> -->
	
	<input type="text" readonly="true" size ="80" maxLength="80" style="background-color:#ffefd5;border-style:None"><xsl:attribute name="value"><xsl:value-of select="leafText"/></xsl:attribute></input> 
	</a><br/>
</xsl:template>
<!-- avoid output of text node with default template -->
<xsl:template match="branchText"/>
</xsl:stylesheet>