我创建了一个.xsl
文件来转换原子提要,以便在浏览器中友好地查看。在 Chrome 中查看时效果很好,但 IE (9.0.811) 样式表被忽略。
我的问题是:我可以改变什么,以便 Internet Explorer 处理样式表,就像它处理 Chrome 一样?
示例原子文件:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/css/atom.xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><![CDATA[A title here]]></title>
<subtitle><![CDATA[A CDATA description here.]]></subtitle>
<link href="http://www.site.com/channel" title="a title" rel="alternate" type="text/html" hreflang="en" />
<link href="http://www.site.com/channel/atom" rel="self" type="application/rss+xml" />
<id>http://www.site.com/channel</id>
<rights>All content © 2006-2013 Site Name unless otherwise noted. All rights reserved.</rights>
<updated>2011-12-18T20:34:31Z</updated>
<category term="Domain: Cat/Subcat" label="Heirarchy Label" />
<author>
<name>Editor's Desk</name>
<email>editors@site.com</email>
<uri>http://www.site.com/members/username</uri>
</author>
<logo>http://www.site.com/img/logo.gif</logo>
<entry>
<title><![CDATA[Some CDATA here]]></title>
<link href="http://www.site.com/channel/article-name" title="Article Name" rel="alternate" type="text/html" hreflang="en" />
<id>http://www.site.com/channel/article-name</id>
<content type="html"><![CDATA[<h3>New Post - Title</h3><p>A new post has been published titled "<a href="http://www.site.com/channel/article-name" title="Article Title">Article Title</a>".</p><p>Click the link above to go to the full biography and to view other user's ratings and comments.</p><p>Article posted in: <i>section -> subsection -> subcat</i>.</p>]]></content>
<author>
<name>Editor's Desk</name>
<email>editors@site.com</email>
<uri>http://www.site.com/members/username</uri>
</author>
<category term="Domain: Cat/Subcat" label="text label here" />
<rights>All content © 2006-2013 Site Name unless otherwise noted. All rights reserved.</rights>
<published>2011-12-18T20:34:31Z</published>
<updated>2011-12-18T20:34:31Z</updated>
</entry>
以及该文件的相关摘录.xsl
:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:atom="http://www.w3.org/2005/Atom">
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes" />
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
<xsl:value-of select="atom:feed/atom:title"/>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/css/style.css" />
</head>
<body>
<div id="container">
<xsl:variable name="feed-title">
<xsl:value-of select="atom:feed/atom:title" />
</xsl:variable>
<xsl:variable name="feed-uri">
<xsl:value-of select="atom:feed/atom:link[2]/@href" />
</xsl:variable>
<xsl:variable name="web-uri">
<xsl:value-of select="atom:feed/atom:link[1]/@href" />
</xsl:variable>
<h1>Atom Feed - <xsl:value-of select="atom:feed/atom:title" /></h1>
<p><xsl:value-of select="atom:feed/atom:subtitle" /></p>
<p><a href="{$feed-uri}"><img src="/img/i/atom-feed.png" alt="{$feed-title}" /></a> - <a href="{$feed-uri}"><xsl:value-of select="atom:feed/atom:title" /></a><br /><xsl:value-of select="feed/link[1]/@href" /></p>
<p>To subscribe to this RSS feed:</p>
<ul>
<li>Drag the orange RSS button or text link above into your news reader</li>
<li>Cut and paste this page's URL into your news reader</li>
</ul>
<p>Alternatively, you can <a title="{$feed-title}" href="{$web-uri}">view the actual online version</a> of this content.</p>
</div>
<div id="footer">
<xsl:value-of select="atom:feed/atom:rights" />
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>