以文本方式查看主题

-  中文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=6915)


--  作者:huting
--  发布时间:4/21/2004 4:22:00 PM

--  各位请下来看看我下面程序问题在哪里?怎么不能输出结果来?(急求解答)
=============================================
catalog.xml

<?xml version="1.0" encoding="gb2312" ?>
<?xml-stylesheet type="text/xsl" href="Find.xsl"  ?>

<Catalog>
   <Book>
      <Title>IE5 XML Programmer's Reference</Title>
      <Authors>
         <Author>11</Author>
      </Authors>
      <Publisher>Wrox Press,Ltd.</Publisher>
      <Abstratct>Reference of XML capabilities in IE5</Abstratct>
      <ISBN>1-861001-57-6</ISBN>
      <RecSubjCategories>
          <Catagory>Internet</Catagory>
          <Catagory>Web Publishing</Catagory>
          <catagory>XML</catagory>
      </RecSubjCategories>
      <Price>$49.99</Price>
   </Book>
   <Book>
      <Title>XML Programmer Development</Title>
      <Authors>
         <Author>Alex Homer</Author>
      </Authors>
      <Publisher>Wrox Press,Ltd.</Publisher>
      <Abstratct>Reference of XML capabilities in IE5</Abstratct>
      <ISBN>1-861001-57-8</ISBN>
      <RecSubjCategories>
          <Catagory>Internet</Catagory>
          <Catagory>Web Publishing</Catagory>
          <catagory>XML</catagory>
      </RecSubjCategories>
      <Price>$80</Price>
   </Book>
   
   <Book>
      <Title>c++ Programmer's Reference</Title>
      <Authors>
         <Author>Alex John</Author>
      </Authors>
      <Publisher>Wrox Press,Ltd.</Publisher>
      <Abstratct>Reference of XML capabilities in IE5</Abstratct>
      <ISBN>1-861001-99-6</ISBN>
      <RecSubjCategories>
          <Catagory>Internet</Catagory>
          <Catagory>Web Publishing</Catagory>
          <catagory>C++</catagory>
      </RecSubjCategories>
      <Price>$60</Price>
   </Book>
   
   <Book>
      <Title>Delphi6.0 Programmer's Reference</Title>
      <Authors>
         <Author>MaxJohn Homer</Author>
      </Authors>
      <Publisher>SunCrop Ltd.</Publisher>
      <Abstratct>Reference of Delphi capabilities in IE5</Abstratct>
      <ISBN>1-861999-57-6</ISBN>
      <RecSubjCategories>
          <Catagory>Application</Catagory>
          <Catagory>Publishing</Catagory>
          <catagory>Delphi</catagory>
      </RecSubjCategories>
      <Price>$88</Price>
   </Book>
</Catalog>
=============================================

Find.xsl
=============================================
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="Catalog">
  <xsl:copy>
    <xsl:for-each select="//Book[Authors/Author=11]">
        <xsl:copy>
            <xsl:apply-templates name="childnodes"/>
        </xsl:copy>
    </xsl:for-each>
  </xsl:copy>
</xsl:template>
 
<xsl:template name="childnodes" match="*">
   <xsl:copy>
   <xsl:apply-templates name="childnodes"/>
   </xsl:copy>
</xsl:template>

</xsl:stylesheet>

=============================================


--  作者:diegor
--  发布时间:4/23/2004 2:10:00 PM

--  
<xsl:apply-templates name="childnodes"/>
这个语法不对,apply没有name属性!
只有call-apply有name属性
--  作者:huting
--  发布时间:4/27/2004 8:25:00 AM

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