-- 作者:whittiy07
-- 发布时间:3/24/2008 7:44:00 PM
-- [求助]Required attribute 'match' is missing,疑惑中......
错误为: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. -------------------------------------------------------------------------------- Required attribute 'match' is missing. 文件为film.xml: <?xml version="1.0" encoding="gb2312"?> <?xml-stylesheet type="text/xsl" href="film.xsl" ?> <root> <china> <film> <name>刮痧</name> <director>郑晓龙</director> <review>一部反映东西文化冲突、而又相互融合的影片</review> <stars>梁家辉</stars> <stars>蒋雯丽</stars> </film> <film> <name>幸福时光</name> <director>张艺谋</director> <review>张艺谋的最新作品</review> <stars>赵本山</stars> <stars>董洁</stars> </film> </china> <foreign> <film> <name>勇敢的心</name> <director>梅尔.吉布森</director> <review>苏格兰的民族英雄威廉.华莱士的故事</review> <stars>梅尔.吉布森</stars> <stars>索菲.玛索</stars> </film> <film> <name>辛德勒的名单</name> <director>斯皮尔伯格</director> <review>二次世界大战期间,企业家辛德勒救助集中营中的犯人的故事</review> <stars>利亚姆.尼森</stars> <stars>本.金斯</stars> </film> </foreign> </root> ---------------------------------------------------------------------------------------------------------------- film.xsl: <?xml version="1.0" encoding="gb2312"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes" /> <xsl:template> <xsl:apply-templates /> </xsl:template> <xsl:template match="china"> <span style="font-size:14pt; color:red; font-weight:bolder; display:block; text-align:center;">中国影片</span> <table width="80%" align="center" border="1"> <xsl:for-each select="film"> <tr> <td colspan="1" width="20%">片名</td> <td colspan="3"><xsl:apply-templates select="name" /></td> </tr> <tr> <td>导演</td> <td width="20%"><xsl:apply-templates select="director" /></td> <td width="10%">主演</td> <td><xsl:apply-templates select="stars" /></td> </tr> <tr> <td>内容简介</td> <td colspan="3"><xsl:apply-templates select="review" /></td> </tr> </xsl:for-each> </table> </xsl:template> <xsl:template match="foreign"> <span style="font-size:14pt; color:red; font-weight:bolder; display:block; text-align:center;">外国影片</span> <table width="80%" align="center" border="1"> <xsl:for-each select="film"> <tr> <td colspan="1" width="20%">片名</td> <td colspan="3"><xsl:apply-templates select="name" /></td> </tr> <tr> <td>导演</td> <td width="20%"><xsl:apply-templates select="director" /></td> <td width="10%">主演</td> <td><xsl:apply-templates select="stars" /></td> </tr> <tr> <td>内容简介</td> <td colspan="3"><xsl:apply-templates select="review" /></td> </tr> </xsl:for-each> </table> </xsl:template> <!-- 定义最底层的模板 --> <xsl:template match="name"> <xsl:value-of /> </xsl:template> <xsl:template match="director"> <xsl:value-of /> </xsl:template> <xsl:template match="stars"> <xsl:value-of /> </xsl:template> <xsl:template match="review"> <xsl:value-of /> </xsl:template> </xsl:stylesheet> 这是怎么回事?刚学xml,求教高手解答。
|