<?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>
			<link rel="stylesheet" type="text/css" href="/Styles/xmlTree.css"/>
			<script type="text/javascript" src="/Scripts/xmlTree.js"></script>
		</head>
		<xsl:apply-templates/>
	</html>
</xsl:template>

<xsl:template match='tree'>
	<body>
		<xsl:apply-templates/>
	</body>
</xsl:template>

<xsl:template match='root'>
	<span class='trigger'>	
	<xsl:attribute name='onClick'>showTreeView("<xsl:value-of select='rootId'/>","<xsl:value-of select='rootValue'/>","<xsl:value-of select='rootCaption'/>");</xsl:attribute>	
	 <xsl:attribute name='onkeydown'>changeKeyCode("<xsl:value-of select='rootId'/>","<xsl:value-of select='rootValue'/>","<xsl:value-of select='rootCaption'/>");</xsl:attribute>	
	<img src='/Images/workflow_select.gif'><xsl:attribute name='id'>I<xsl:value-of select='rootId'/></xsl:attribute></img>
	<!-- <xsl:value-of select="rootCaption"/> -->
	<input type='text' readonly='true'  size ="80" maxLength="80" style='background-color:#D5E2F3;border-style:None;width:400'><xsl:attribute name='id'>F<xsl:value-of select='rootId'/></xsl:attribute><xsl:attribute name='value'><xsl:value-of select='rootCaption'/></xsl:attribute>
	</input>
	<br/>
	</span>
	<span class='root'>					
		<xsl:attribute name='id'><xsl:value-of select='rootId'/></xsl:attribute>				
		<xsl:apply-templates/>
	</span>
</xsl:template>

<xsl:template match='node'>

<a class='triggerleaf'>
<!-- <span class="triggerleaf"> -->
<xsl:attribute  name='ONCLICK' >select("<xsl:value-of select='nodeId'/>","<xsl:value-of select='nodeCaption'/>","<xsl:value-of select='nodeValue'/>");</xsl:attribute>
<xsl:attribute name='onkeydown'>select("<xsl:value-of select='nodeId'/>","<xsl:value-of select='nodeCaption'/>","<xsl:value-of select='nodeValue'/>");</xsl:attribute>	
<xsl:attribute name='onfocus'>select("<xsl:value-of select='nodeId'/>","<xsl:value-of select='nodeCaption'/>","<xsl:value-of select='nodeValue'/>");</xsl:attribute>	

<img src='/Images/workflow_icon.gif'/>
<!-- <xsl:value-of select="nodeCaption"/>  -->
<input type='text' readonly='true' style='background-color:#D5E2F3;border-style:None;width:400'><xsl:attribute name='id'>F<xsl:value-of select='nodeId'/></xsl:attribute><xsl:attribute name='value'><xsl:value-of select='nodeCaption'/></xsl:attribute>
<xsl:attribute name='onfocus'>select("<xsl:value-of select='nodeId'/>","<xsl:value-of select='nodeCaption'/>","<xsl:value-of select='nodeValue'/>");</xsl:attribute>	
<xsl:attribute name='onkeydown'>select("<xsl:value-of select='nodeId'/>","<xsl:value-of select='nodeCaption'/>","<xsl:value-of select='nodeValue'/>");</xsl:attribute>	
</input>
</a>
<!--  </span>  -->
<br/>
</xsl:template>

<!-- avoid output of default template -->
<xsl:template match="rootCaption"/>
<xsl:template match="rootId"/>
<xsl:template match="rootValue"/>
<xsl:template match="nodeId"/>
<xsl:template match="nodeCaption"/>

</xsl:stylesheet>
