以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XSL/XSLT/XSL-FO/CSS 』  (http://bbs.xml.org.cn/list.asp?boardid=8)
----  菜鸟问题求助啊,很急[求助]  (http://bbs.xml.org.cn/dispbbs.asp?boardid=8&rootid=&id=9839)


--  作者:ty44092003
--  发布时间:9/8/2004 11:36:00 AM

--  菜鸟问题求助啊,很急[求助]
这分别是xsl 和xml 文件
<?xml version="1.0" encoding="GB2312"?>                       <xsl:stylesheetxmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<head>
<title>xpath></title>
</head>
<body>
<xsl:value-of select="/order/item[last()]"/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

<?xml version="1.0" encoding="gb2312"?>                 
<?xml:stylesheet type="text/xsl" href="xpath.xsl"?>
<order>
  <item catalog="parts">
    <itemNumber>C2688-67037</itemNumber>
    <description>LCD液晶显示器</description>
    <quantity>1</quantity>
    <price>358.00</price>
  </item>
    <item catalog="parts">
    <itemNumber>C2688-67061</itemNumber>
    <description>音箱</description>
    <quantity>1</quantity>
    <price>16.50</price>
  </item>
    <item catalog="parts">
    <itemNumber>C2688-67010</itemNumber>
    <description>鼠标</description>
    <quantity>1</quantity>
    <price>8.50</price>
  </item>
</order>
结果如下:
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

Unknown method. /order/item[-->last()<--]

这是为什么啊


--  作者:alextoby
--  发布时间:9/8/2004 11:57:00 AM

--  
你的<xsl:stylesheetxmlns:xsl="http://www.w3.org/TR/WD-xsl">
这句话打错了,中间有空格的

<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">


--  作者:ty44092003
--  发布时间:9/8/2004 12:19:00 PM

--  
没错,我是复制时出的错,我用/order/item[1]都可以行的
--  作者:doubleG
--  发布时间:9/8/2004 3:55:00 PM

--  
请你名称空间声明用正式版http://www.w3.org/1999/XSL/Transform就支持了
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
46.875ms