以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 XSL/XSLT/XSL-FO/CSS 』  (http://bbs.xml.org.cn/list.asp?boardid=8)
----  IE6.0支持XSL吗?[求助]  (http://bbs.xml.org.cn/dispbbs.asp?boardid=8&rootid=&id=14606)


--  作者:binaryluo
--  发布时间:2/19/2005 12:38:00 PM

--  IE6.0支持XSL吗?[求助]
我写了一个XML文件和一个样式表,用IE6.0打开却不能显示XML中的内容。源文件如下:
Vehicles.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 = "1997" make = "Land Rover" model = "Discovery">
  <mileage>46000</mileage>
  <color>silver</color>
  <price>$27900</price>
 </vehicle>

 <vehicle year = "1997" make = "Land Rover" model = "Defender 90">
  <mileage>21050</mileage>
  <color>white</color>
  <price>$41900</price>
 </vehicle>

 <vehicle year = "1994" make = "Land Rover" model = "Defender 90">
  <mileage>42450</mileage>
  <color>green</color>
  <price>$31250</price>
 </vehicle>

 <vehicle year = "1996" make = "Toyota" model = "Land Cruiser">
  <mileage>47150</mileage>
  <color>black</color>
  <price>$37000</price>
 </vehicle>

 <vehicle year = "1997" make = "Toyota" model = "Land Cruiser">
  <mileage>34800</mileage>
  <color>green</color>
  <price>$37000</price>
 </vehicle>

 <vehicle year = "1999" make = "Chevrolet" model = "Suburban 2500">
  <mileage>3550</mileage>
  <color>pewter</color>
  <price>$31995</price>
 </vehicle>

 <vehicle year = "1996" make = "Chevrolet" model = "Suburban 2500">
  <mileage>49300</mileage>
  <color>green</color>
  <price>$25995</price>
 </vehicle>
</vehicles>

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>
    <h1 style = "background-color: #446600;
    color: #FFFFFF; font = size: 20pt; text-align: center;
    letter-spacing: 1.0em">Used Vehicles</h1>
    <table align = "center" border = "2">
     <tr>
      <th>Year</th>
      <th>Make</th>
      <th>Model</th>
      <th>Mileage</th>
      <th>Color</th>
      <th>Price</th>
     </tr>

     <xsl:for-each order-by = "+ price" 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>

以上文件都没有语法错误了,但就是不能显示XML中的内容。是否是IE6.0不支持XSL?
敬请高手指点!


--  作者:binaryluo
--  发布时间:2/19/2005 5:10:00 PM

--  
已经解决了,是文件保存时的编码问题。
--  作者:菜籽
--  发布时间:2/24/2005 11:20:00 AM

--  
呵呵
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
31.250ms