1<?xml version="1.0"?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3<xsl:output method="html"></xsl:output>
4<xsl:template match="/">
5<html>
6<head>
7<title>XML Tree Control</title>
8<link rel="stylesheet" type="text/css" href="xmlTree.css"/>
9<script type="text/javascript" src="xmlTree.js"></script>
10</head>
11<xsl:apply-templates/>
12</html>
13</xsl:template>
14
15<xsl:template match="tree">
16<body>
17<xsl:apply-templates/>
18</body>
19</xsl:template>
20
21
22<xsl:template match="branch">
23<span class="trigger">
24<xsl:attribute name="onClick">
25showBranch('<xsl:value-of select="@id"/>');
26</xsl:attribute>
27<img src="open.gif">
28<xsl:attribute name="id">I<xsl:value-of select="@id"/></xsl:attribute>
29</img>
30
31<a class="box">
32<xsl:attribute name="href" >
33<xsl:value-of select="@link"/>
34</xsl:attribute>
35<xsl:value-of select="branchText"/>
36</a>
37<br/>
38</span>
39<span class="branch">
40<xsl:attribute name="id">
41<xsl:value-of select="@id"/>
42</xsl:attribute>
43<xsl:apply-templates/>
44</span>
45</xsl:template>
46
47
48<xsl:template match="leaf">
49<span class="leaf">
50<img src="doc.gif" width="16"/>
51<a class="box">
52<xsl:attribute name="href" >
53<xsl:value-of select="@link"/>
54</xsl:attribute>
55<xsl:value-of select="leafText"/>
56</a><br/>
57</span>
58</xsl:template>
59
60<xsl:template match="branchLink">
61<span class="trigger">
62<xsl:attribute name="onClick">
63highlightBranch('<xsl:value-of select="@id"/>');
64</xsl:attribute>
65<img src="arrow.gif"/>
66<a class="box">
67<xsl:attribute name="href" >
68<xsl:value-of select="@link"/>
69</xsl:attribute>
70<xsl:value-of select="branchText"/>
71</a><br/>
72</span>
73</xsl:template>
74
75<!-- avoid output of text node with default template -->
76<xsl:template match="branchText"/>
77
78</xsl:stylesheet>
79