xsl草案:
1<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/TR/WD-xsl">
2<xsl:template match="/">
3<script language="Javascript">
4<![CDATA[
5function hideiemenu(){
6return false;
7}
8function load()
9{
10document.oncontextmenu=hideiemenu;
11
12if (form1.员工工号.value=="")
13{
14form1.员工工号.focus();
15}
16tree();
17}
18function tree()
19{
20//form1.TreeView1.Nodes.Add(); // form1.TreeView1未定义
21}
22]]>
23</script>
24<html>
25<head>
26<title>查询员工</title>
27</head>
28<body onload="load()">
29<xsl:apply-templates select="CD/查询员工"></xsl:apply-templates>
30</body>
31</html>
32</xsl:template>
33<xsl:template match="查询员工">
34<form action="" method="post" name="form1">
35<table align="center" border="3" cellspacing="0" width="974">
36<tr>
37<td height="445" width="831"><table align="center" border="0" cellpadding="0" cellspacing="0" height="430" width="100%">
38<tr>
39<td height="26"><table align="center" border="0" cellpadding="0" cellspacing="0" height="36" width="95%">
40<tr>
41<td height="36" width="7%"><font face="宋体" size="2">员工工号</font></td>
42<td width="41%"><table border="0" cellpadding="0" cellspacing="0" height="18" width="84%">
43<tr>
44<td><input name="员工工号" type="text"/></td>
45</tr>
46</table></td>
47<td width="12%"><table border="0" cellpadding="0" cellspacing="0" height="18" width="29%">
48<tr>
49<td width="57%"><table border="0" cellpadding="0" cellspacing="0" width="20%">
50<tr>
51<td><input name="Submit" style="width:60" type="submit" value="查询"/></td>
52</tr>
53</table></td>
54</tr>
55</table></td>
56<td width="40%"></td>
57</tr>
58</table></td>
59</tr>
60<tr>
61</tr>
62<tr>
63<td height="20"> <hr align="center" size="1"/>
64<!-- amend start -->
65<table align="center" border="0" cellpadding="0" cellspacing="2" width="100%">
66<tr bgcolor="#C9D7E9">
67<td align="center">序号</td>
68<xsl:for-each select="员工/*">
69<!--<xsl:if test=".">\-->
70<td align="center">
71<xsl:eval>
72if (this.tagName != 'DATA')
73this.tagName
74</xsl:eval>
75</td>
76<!--</xsl:if>\-->
77</xsl:for-each>
78</tr>
79<xsl:for-each select="员工/DATA/ROW">
80<tr>
81<td align="center" bgcolor="#F5F5F5">
82<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>
83</td>
84<xsl:for-each select="@*">
85<td align="center" bgcolor="#F5F5F5">
86<xsl:value-of select="."></xsl:value-of>
87</td>
88</xsl:for-each>
89</tr>
90</xsl:for-each>
91</table>
92<!-- amend end -->
93</td>
94</tr>
95<tr>
96<td height="250"></td>
97</tr>
98</table></td>
99</tr>
100</table>
101</form>
102</xsl:template>
103</xsl:stylesheet>