I'm looking at the Astoria blog's RSS feed and it appears that they do something to make the RSS feed look we开发者_如何转开发bpage like, instead of the standard RSS XML feed. I'm guessing they check the useragent and alter the response accordingly.
How can I offer a similar "nice" rss feed that looks good to web browsers and still works for RSS readers as well.
They are using a XSLT transformation! Since the feeds are just XML you can transform them in order to display them nicely in browsers. RSS readers will ignore the stylesheet and the user will be able to read the feed items. On the provided feed you can take a look a the following line:
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?>
What it does is actually transforming the XML into HTML so that you are able to see it in your browser.
精彩评论