以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 XML源码及示例(仅原创和转载) 』  (http://bbs.xml.org.cn/list.asp?boardid=32)
----  求助,一个简单的问题.  (http://bbs.xml.org.cn/dispbbs.asp?boardid=32&rootid=&id=20834)


--  作者:zy122
--  发布时间:8/2/2005 9:54:00 AM

--  求助,一个简单的问题.
portfolio.xml的代码:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="portfolio.xsl"?>
<portfolio>
 <stock exchange="nyse">
  <name>zacx corp</name>
  <symbol>zcxm</symbol>
  <price>28.875</price>
 </stock>
 <stock exchange="nasdaq">
  <name>zaffymat inc</name>
  <symbol>zffx</symbol>
  <price>92.250</price>
 </stock>
</portfolio>


portfolio.xsl的代码:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/tr/wd-xsl">
<xsl:template match="/">
<html>
<body>
<table border="2" bgcolor="yellow">
 <tr>
 <th>Symbol</th>
 <th>Name</th>
 <th>Price</th>
 </tr>
 <xsl:for-each select="portfolio/stock">
 <tr>
  <td><xsl:value-of select="symbol"/></td>
  <td><xsl:value-of select="name"/></td>
  <td><xsl:value-of select="price"/></td>
 </tr>
 </xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>


显示内容为:
Symbol Name Price
   
.xml里面的内容为什么不能显示出来?
本人初学XML,请大虾指导.


--  作者:sam
--  发布时间:8/2/2005 12:00:00 PM

--  
这东西是分大小写的 http://www.w3.org/TR/WD-xsl
--  作者:zy122
--  发布时间:8/2/2005 4:24:00 PM

--  
成功解决问题,不甚感谢.
--  作者:9doit
--  发布时间:8/2/2005 6:31:00 PM

--  
不愧是高手,今天我也学到了
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
31.250ms