开发者

Implement HTML response on WCF-based RSS/ATOM if useragent is IE?

开发者 https://www.devze.com 2023-01-24 18:41 出处:网络
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 chec

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消