Home > C#

Read Value for media:thumbnail Linq to Xml

28. June 2010
I was playing around with my HULU rss feed the other day and was using silverlight to just read and display the queue. I was using Linq to XML to read the feed. I know in Silverlight 4 there is a class to help read the RSS Feed, but I wanted to make my own class and use Linq to XML just in case I wanted to expand on it.

Anyhow, the reason for this post is I couldn't figure out how to parse the following elements in the item element

After searching around a bit I found some good examples, but they were either outdated or just didn't seem to work the way I wanted. However, they did get me going in the right direction.

In short here, here is one way of accomplishing it

Here is part of the code in how it's used:

Part of RSS Feed

Here is the LINQ to XML code to read the RSS Feed.

Here is a link to the GetNamespaceOfPrefix method()

http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.getnamespaceofprefix.aspx

Ok...enjoy.

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

C#

blog comments powered by Disqus