为什么xml网页显示不正常?
这是一本书上的例子,我不知道问题出在哪里,请那位高手指点迷津!
xml:
<?xml version="1.0"?>
<?xml-stylesheet href="Vehicles.xsl" type="text/xsl"?>
<vehicles>
<vehicle year="1996" make="Land Rover" model="Discovery">
<mileage>36500</mileage>
<color>black</color>
<price>$22100</price>
</vehicle>
<vehicle year="1998" make="Land Rover" model="Discovery">
<mileage>15900</mileage>
<color>teal</color>
<price>$32000</price>
</vehicle>
<vehicle year="1997" make="Land Rover" model="Discovery">
<mileage>46000</mileage>
<color>silver</color>
<price>$27900</price>
</vehicle>
</vehicles>
xsl:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD=xsl">
<xsl:template match="/">
<html><head><title>Used Vehicles></title></head>
<body background="5.gif">
<h1>Used Vehicles</h1>
<table align="center" border="1">
<tr>
<th>Year</th>
<th>Make</th>
<th>Model</th>
<th>Mileage</th>
<th>Color</th>
<th>Price</th>
</tr>
<xsl:for-each select="vehicles/vehicle">
<tr>
<td><xsl:value-of select="@year"/></td>
<td><xsl:value-of select="@make"/></td>
<td><xsl:value-of select="@model"/></td>
<td><xsl:value-of select="mileage"/></td>
<td><xsl:value-of select="color"/></td>
<td><xsl:value-of select="price"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
表格的头可以正常显示,但是关于vehicle的内容一项都显示不出来!在win2000和winXP下都不行!!!
问题点数:20、回复次数:3Top
1 楼net_lover(【孟子E章】)回复于 2002-04-01 15:53:15 得分 10
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD=xsl">
应该为:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">Top
2 楼beetleking()回复于 2002-04-01 16:02:31 得分 0
我是初学者,对付这类错误,有没有什么工具可以使用?请net_lover(孟子E章) 大虾赐教!Top
3 楼mirrorsite(燕斩)回复于 2002-04-01 16:52:48 得分 10
xml spyTop




