帮忙看下我的XSL中的for-each为何没用?
qfljm 2005-06-18 01:43:48 test.xml
<?xml version="1.0" encoding="gb2312"?>
<?xml-stylesheet type="text/xsl" href="./test.xsl"?>
<root>
<infolist listnums="10">
<info>
<id>1</id>
<sBody>中华人民共和国</sBody>
<sTime>2005-4-3 23:20:22</sTime>
<sIp>127.0.0.1</sIp>
</info>
<info>
<id>2</id>
<sBody>中华人民共和国</sBody>
<sTime>2005-4-3 23:20:23</sTime>
<sIp>127.0.0.1</sIp>
</info>
<info>
<id>3</id>
<sBody>wanghr100111</sBody>
<sTime>2005-4-3 23:20:24</sTime>
<sIp>127.0.0.1</sIp>
</info>
</infolist>
</root>
test.xsl
<?xml version="1.0" encoding="gb2312" ?>
<!DOCTYPE HTML [
<!ENTITY nbsp " ">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="gb2312" indent="no"/>
<xsl:template match="/">
<html>
<head>
<title><xsl:value-of select="/root/infolist/@listnums" /></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
</head>
<body bgcolor="F3F2EE" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="1" cellpadding="0" cellspacing="1">
<tr>
<td width="25%" height="30"><strong>编号</strong></td>
<td width="25%"><strong>内容</strong></td>
<td width="25%"><strong>时间</strong></td>
<td width="25%"><strong>IP</strong></td>
</tr>
<xsl:for-each select="/root/infolist/info" />
<tr>
<td width="25%"><xsl:value-of select="id" /></td>
<td width="25%"><xsl:value-of select="sBody" /></td>
<td width="25%"><xsl:value-of select="sTime" /></td>
<td width="25%"><xsl:value-of select="sIp" /></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
----------------
功能:
我想用XSL把TEST.XML中的数据格式化成一个HTML表格式样.