-- 作者: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> =============================================
|