Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在查看 Astoria 博客的RSS 提要,看起来他们做了一些事情来使 RSS 提要看起来像网页,而不是标准的 RSS XML 提要。我猜他们会检查用户代理并相应地更改响应。
我怎样才能提供一个类似的“漂亮”的 RSS 提要,它对 Web 浏览器看起来不错,并且仍然适用于 RSS 阅读器。
他们正在使用 XSLT 转换!由于提要只是 XML,您可以对其进行转换以便在浏览器中很好地显示它们。RSS 阅读器将忽略样式表,用户将能够阅读提要项目。在提供的提要中,您可以查看以下行:
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?>
它所做的实际上是将 XML 转换为 HTML,以便您能够在浏览器中看到它。