关于XML根结点的问题:
cer 2003-12-08 09:15:03 XML文件如下:
=========================================================================
<?xml version="1.0" encoding="GB2312"?>
<所有人物>
<人物>
<姓名>张无忌</姓名>
</人物>
<人物>
<姓名>伟小宝</姓名>
</人物>
</所有人物>
=========================================================================
XSL文件一:
=========================================================================
<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="所有人物">
<html>
<head>
<title>我们的第一个xml例子</title>
</head>
<body>
<table width="100%">
<xsl:apply-templates select="人物"/>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="人物">
<tr>
<xsl:value-of select="./姓名"/>
</tr>
</xsl:template>
</xsl:stylesheet>
=========================================================================
XSL文件二:
=========================================================================
<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<html>
<head>
<title>我们的第一个xml例子</title>
</head>
<body>
<table width="100%">
<xsl:apply-templates select="人物"/>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="人物">
<tr>
<xsl:value-of select="./姓名"/>
</tr>
</xsl:template>
</xsl:stylesheet>
=========================================================================
这两个XSL文件的区别只是将“/”换成了“所有人物”为什么输出给果不一样,难道“所有人物”不是根结点吗?