以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 XML基础 』  (http://bbs.xml.org.cn/list.asp?boardid=1)
----  这个错误是什么?  (http://bbs.xml.org.cn/dispbbs.asp?boardid=1&rootid=&id=7052)


--  作者:joyce_hua
--  发布时间:4/27/2004 11:31:00 AM

--  这个错误是什么?
这是一个关于表格显示上的问题。这个代码应该是对的,可是浏览器却显示错误方法未知:    ../product[index()$gt$ context()!-->indext()<--][0]
<?xml version="1.0" encoding="gb2312" ?>
<?xml-stylesheet type="text/xsl" href="product.xsl" ?>
<products>
  <product>办公室圆桌</product>
  <product>老花眼镜</product>
  <product>家用弹簧秤</product>
  <product>手提电脑包</product>
  <product>电视天线</product>
  <product>智力拼图</product>
  <product>绘图工具</product>
  <product>硬面笔记本</product>
  <product>农场机械</product>
  <product>玩具小丑</product>
  <product>潜水装备</product>
</products

xsl:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
  <html>
    <body style="font:bold 10pt Verdana">
    <div>Three column table:</div>
       <table border="1">
        <span style="font-family:Arial;color:pink">
         <xsl:for-each select="products/product">
           <xsl:if expr="(childNumber(this)%3)==1">
              <tr>
                <td><xsl:value-of/></td>
                <td><xsl:value-of select="../product[index()$gt$  context()!indext()][0]"/></td>
                <td><xsl:value-of select="../product[index()$gt$ context()!indext()][1]"/></td>
              </tr>
           </xsl:if>
          </xsl:for-each>
        </span>
       </table>
      </body>
     </html>
    </xsl:template>
   </xsl:stylesheet>
我想要达到的效果就是把这些列表项目逐个放到表格中去,每行三列。
--  作者:sam
--  发布时间:4/27/2004 12:06:00 PM

--  
indext() 改为 index()
--  作者:joyce_hua
--  发布时间:4/28/2004 9:03:00 AM

--  
噢原来是这个地方,多谢。现在好了:)
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
31.250ms