xml和xsl语言问题,高手进

来源:百度知道 编辑:UC知道 时间:2024/05/31 09:07:45
现有一xml文件,1.xml其代码如下:

<?xml version="1.0" encoding="GB2312"?>
<?xml-stylesheet type="text/xsl" href="1.xsl"?>
<联系人列表>
<联系人>
<姓名>李明</姓名>
<电话>83590000</电话>
</联系人>
<联系人>
<姓名>李明B</姓名>
<电话>83590001</电话>
</联系人>
</联系人列表>

另有一xsl文件,1.xsl其代码如下:

<?xml version="1.0" encoding="GB2312"?>
<xsl:stylesheet xmlns:xsl="www.jdsu.com">
<xsl:template match="/">
<html>
<body>
<table border="2">
<tr>
<td>姓名</td>
<td>电话号码</td>
</tr>
<xsl:for-each select="联系人列表/联系人">
<tr>
<td><xsl:value-of select="姓名"

第二行的声明不对,改为:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">