我有一个简单的 XML 文件,并且正在尝试创建一个 XSLT 文件来将 XML 处理为 HTML。
XML
<?xml version="1.0" ?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>PDF</title>
<ttl>10</ttl>
<link>https://teele.box.com/shared/3m9en769bdh36d4y2hjy/rss.xml</link>
<description>PDF file updates</description>
<lastBuildDate>Tue, 05 Mar 2013 13:59:22 -0800</lastBuildDate>
<copyright>Copyright 2009 box.net</copyright>
<webMaster>no-reply@box.com (No reply)</webMaster>
<item>
<title>Kat Martin - Sinclair Sisters Trilogy 02 - Desert Heat.pdf</title>
<description></description>
<pubDate>Sun, 03 Feb 2013 17:19:36 -0800</pubDate>
<link>https://teele.box.com/index.php?rm=box_download_shared_file&shared_name=3m9en769bdh36d4y2hjy&file_id=f_5920615203&rss=1</link>
<media:content url="https://teele.box.com/index.php?rm=box_download_shared_file&shared_name=3m9en769bdh36d4y2hjy&file_id=f_5920615203&rss=1" />
<media:text></media:text>
<media:title>Kat Martin - Sinclair Sisters Trilogy 02 - Desert Heat.pdf</media:title>
<media:thumbnail url="https://ak3.boxcdn.net/resources/rcxnqksqis/thumbs/43x51/application/pdf.gif" height="48" width="48"/>
</item>
和我的 XSLT
<?xml version='1.0'?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:media="http://search.yahoo.com/mrss/">
<xsl:output method="html" />
<xsl:template name="Content">
<xsl:for-each select="rss/channel/item">
<xsl:value-of select="media:thumbnail/@url"/>
</xsl:for-each>
</xsl:template>
<xsl:template match="/">
<xsl:call-template name="Content" />
</xsl:template>
</xsl:stylesheet>
当我处理这个时,我从我正在测试 XSLT的http://www.online-toolz.com/tools/xslt-transformation.php收到以下错误
错误:XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: xsl:version: only 1.0 features are supported
它与 media: 标签有关,但我不知道它是什么意思,我定义了命名空间。