以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XQuery/XLink/XPointer/ 』  (http://bbs.xml.org.cn/list.asp?boardid=14)
----  请高手帮忙  (http://bbs.xml.org.cn/dispbbs.asp?boardid=14&rootid=&id=14055)


--  作者:settingyin
--  发布时间:1/27/2005 2:07:00 PM

--  请高手帮忙
这是.xml文件
<?xml version="1.0" encoding="GB2312"?>
<?xml-stylesheet type="text/xsl" href="F:\develop\xml\test2.xsl"?>
<catalog>
 <cd country="USA">
  <title>Empire Burlesque</title>
  <artist>Bob Dylan</artist>
  <price>10.90</price>
 </cd>
 <cd country="UK">
  <title>Hide your heart</title>
  <artist>Bonnie Tyler</artist>
  <price>9.90</price>
 </cd>
 <cd country="USA">
  <title>Greatest Hits</title>
  <artist>Dolly Parton</artist>
  <price>9.90</price>
 </cd>
</catalog>

下面是.xsl文件
<?xml version="1.0" encoding="GB2312"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2004/07/xpath-functions" xmlns:xdt="http://www.w3.org/2004/07/xpath-datatypes">
<xsl:template match="/">
<xsl:value-of select="/catalog/cd "/>
</xsl:template>

</xsl:stylesheet>

很多教材说/catalog/cd是选中catalog下所有cd元素 可是上面的程序显示的是第一个cd啊


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