下面的简单的代码用了一个for-each 想要读出所有达发公司的员工
但结果却是:a 小禹 123321 小禹
只输出了一个员工的资料
//1.xml
<达发公司>
<员工>a
<姓名>小禹
<电话>123321
<员工>b
<姓名>春华
<电话>345543
<员工>c
<姓名>秋实
<电话>678876
//1.xsl
1<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
2<xsl:template match="/">
3<html>
4<body>
5<table>
6<tr>
7<td><b>name</b></td>
8</tr>
9<xsl:for-each select="达发公司">
10<tr bgcolor="#aaaaaa">
11<td>
12<xsl:value-of select="员工"></xsl:value-of>
13<xsl:value-of select="员工/姓名"></xsl:value-of>
14</td>
15</tr>
16</xsl:for-each>
17</table>
18</body>
19</html>
20</xsl:template>
21</xsl:stylesheet>
---------------------------------------------------------------
1<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
2<xsl:template match="/">
3<html>
4<body>
5<table>
6<tr>
7<td><b>name</b></td>
8</tr>
9<xsl:for-each select="达发公司/员工">
10<tr bgcolor="#aaaaaa">
11<td>
12<xsl:value-of select="姓名"></xsl:value-of>
13</td>
14</tr>
15</xsl:for-each>
16</table>
17</body>
18</html>
19</xsl:template>
20</xsl:stylesheet>