<item>
<title>Kyle Rudolph earns Pro Bowl MVP</title>
<link>http://profootballtalk.nbcsports.com/2013/01/27/kyle-rudolph-earns-pro-bowl-mvp/</link>
<comments>http://profootballtalk.nbcsports.com/2013/01/27/kyle-rudolph-earns-pro-bowl-mvp/#comments</comments>
<pubDate>Mon, 28 Jan 2013 03:58:02 +0000</pubDate>
<dc:creator>Evan Silva</dc:creator>
<guid isPermaLink="false">http://profootballtalk.nbcsports.com/?p=1687021</guid>
<description><![CDATA[Vikings tight end Kyle Rudolph was named the 2013 Pro Bowl’s Most Valuable Player on Sunday after recording five catches for 122 yards and a touchdown in the NFC’s 62-35 win over the AFC. Utilized most frequently by the NFC’s first two quarterbacks to play — Drew Brees of the Saints and the Giants’ Eli…<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=profootballtalk.nbcsports.com&blog=15932921&post=1687021&subd=nbcprofootballtalk&ref=&feed=1" width="1" height="1" />]]></description>
<wfw:commentRss>http://profootballtalk.nbcsports.com/2013/01/27/kyle-rudolph-earns-pro-bowl-mvp/feed/</wfw:commentRss>
<slash:comments>56</slash:comments>
<media:thumbnail url="http://nbcprofootballtalk.files.wordpress.com/2013/01/kyle-rudolph-pic2-e1359344802204.jpg?w=200&h=170&crop=1"/>
<media:content url="http://nbcprofootballtalk.files.wordpress.com/2013/01/kyle-rudolph-pic2-e1359344802204.jpg?w=200&h=170&crop=1" medium="image">
<media:title type="html">Minnesota Vikings Rudolph for the NFC runs the ball between Kansas City Chiefs Berry and Hali during the second quarter the NFL Pro Bowl in Honolulu, Hawaii</media:title>
</media:content>
<media:content url="http://2.gravatar.com/avatar/2d0ecbe8951ceae0d99835937827a670?s=96&d=http%3A%2F%2F2.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&r=G" medium="image">
<media:title type="html">evanssilva</media:title>
</media:content>
</item>
I am trying to get the "media:content url" of the image located:
<media:content url="http://nbcprofootballtalk.files.wordpress.com/2013/01/kyle-rudolph-pic2-e1359344802204.jpg?w=200&h=170&crop=1" medium="image">
<media:title type="html">Minnesota Vikings Rudolph for the NFC runs the ball between Kansas City Chiefs Berry and Hali during the second quarter the NFL Pro Bowl in Honolulu, Hawaii</media:title>
</media:content>
You xml is too complicated, and I did this demo for you:
I've changed your xml and it looks like this below:
<rssversion="2.0"xmlns:content="http://purl.org/rss/1.0/modules/content/"xmlns:wfw="http://wellformedweb.org/CommentAPI/"xmlns:dc="http://purl.org/dc/elements/1.1/"xmlns:atom="http://www.w3.org/2005/Atom"xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"xmlns:slash="http://purl.org/rss/1.0/modules/slash/"xmlns:georss="http://www.georss.org/georss"xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"xmlns:media="http://search.yahoo.com/mrss/" > <item> <title>Kyle Rudolph earns Pro Bowl MVP</title> <link>http://profootballtalk.nbcsports.com/2013/01/27/kyle-rudolph-earns-pro-bowl-mvp/</link> <comments>http://profootballtalk.nbcsports.com/2013/01/27/kyle-rudolph-earns-pro-bowl-mvp/#comments</comments> <pubDate>Mon, 28 Jan 2013 03:58:02 +0000</pubDate> <dc:creator>Evan Silva</dc:creator> <guidisPermaLink="false">http://profootballtalk.nbcsports.com/?p=1687021</guid> <description><![CDATA[Vikings tight end Kyle Rudolph was named the 2013 Pro Bowl’s Most Valuable Player on Sunday after recording five catches for 122 yards and a touchdown in the NFC’s 62-35 win over the AFC. Utilized most frequently by the NFC’s first two quarterbacks to play — Drew Brees of the Saints and the Giants’ Eli…<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=profootballtalk.nbcsports.com&blog=15932921&post=1687021&subd=nbcprofootballtalk&ref=&feed=1" width="1" height="1" />]]></description> <wfw:commentRss>http://profootballtalk.nbcsports.com/2013/01/27/kyle-rudolph-earns-pro-bowl-mvp/feed/</wfw:commentRss> <slash:comments>56</slash:comments> <media:thumbnailurl="http://nbcprofootballtalk.files.wordpress.com/2013/01/kyle-rudolph-pic2-e1359344802204.jpg?w=200&h=170&crop=1"/> <media:contenturl="http://nbcprofootballtalk.files.wordpress.com/2013/01/kyle-rudolph-pic2-e1359344802204.jpg?w=200&h=170&crop=1"medium="image"> <media:titletype="html">Minnesota Vikings Rudolph for the NFC runs the ball between Kansas City Chiefs Berry and Hali during the second quarter the NFL Pro Bowl in Honolulu, Hawaii</media:title> </media:content> <media:contenturl="http://2.gravatar.com/avatar/2d0ecbe8951ceae0d99835937827a670?s=96&d=http%3A%2F%2F2.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&r=G"medium="image"> <media:titletype="html">evanssilva</media:title> </media:content> </item></rss>
XDocumentdoc=XDocument.Load("XMLFile1.xml");
varresult=fromitemindoc.Descendants(XNamespace.Get("http://search.yahoo.com/mrss/")+"content")
selectitem.Attribute("url").Value;
//Print to testforeach (variteminresult)
{
Console.WriteLine(item);
}
This is not my feed. all im trying to do is display a formated feed. only think I havent been able to figure out is how to get the image URL in the "media:content" node using RSSToolKit 2
m_coomer146
Member
37 Points
67 Posts
RSS Datasource
Jan 27, 2013 01:17 PM|LINK
I am using the RSSToolKit 2 on my site. I can connect to the RSS Feed and using a datalist I get this:
<asp:DataList ID="DataList1" runat="server" DataSourceID="RssDataSource1"> <ItemTemplate> title: <asp:Label ID="titleLabel" runat="server" Text='<%# Eval("title") %>' /> <br /> link: <asp:Label ID="linkLabel" runat="server" Text='<%# Eval("link") %>' /> <br /> comments: <asp:Label ID="commentsLabel" runat="server" Text='<%# Eval("comments") %>' /> <br /> pubDate: <asp:Label ID="pubDateLabel" runat="server" Text='<%# Eval("pubDate") %>' /> <br /> category: <asp:Label ID="categoryLabel" runat="server" Text='<%# Eval("category") %>' /> <br /> guid: <asp:Label ID="guidLabel" runat="server" Text='<%# Eval("guid") %>' /> <br /> description: <asp:Label ID="descriptionLabel" runat="server" Text='<%# Eval("description") %>' /> <br /> content:encoded: <asp:Label ID="content_encodedLabel" runat="server" Text='<%# Eval("[content:encoded]") %>' /> <br /> wfw:commentRss: <asp:Label ID="wfw_commentRssLabel" runat="server" Text='<%# Eval("[wfw:commentRss]") %>' /> <br /> slash:comments: <asp:Label ID="slash_commentsLabel" runat="server" Text='<%# Eval("[slash:comments]") %>' /> <br /> media:content: <asp:Label ID="media_contentLabel" runat="server" Text='<%# Eval("[media:content]") %>' /> <br /> <br /> </ItemTemplate> </asp:DataList>When I try to access the "media:content i get an error saying:
DataBinding: 'RssToolkit.RssElementCustomTypeDescriptor' does not allow indexed access.
the "media:content" in the feed has an image URL=myimage.png and a medium="image"
How can I access the URL of the media:content node?
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: RSS Datasource
Jan 29, 2013 01:12 AM|LINK
Hi,
Can you show us your xml contents?
And tell us what values do you wanna retieve from the xml contents?
m_coomer146
Member
37 Points
67 Posts
Re: RSS Datasource
Jan 29, 2013 02:49 AM|LINK
I am trying to get the "media:content url" of the image located:
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: RSS Datasource
Jan 29, 2013 02:54 AM|LINK
Where's the defination of your xml namespace of media? Please full your xml contents.
m_coomer146
Member
37 Points
67 Posts
Re: RSS Datasource
Jan 29, 2013 02:58 AM|LINK
the entire feed is located here
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: RSS Datasource
Jan 29, 2013 03:27 AM|LINK
Are you using net framework 3.5?
m_coomer146
Member
37 Points
67 Posts
Re: RSS Datasource
Jan 29, 2013 04:28 AM|LINK
4.0
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: RSS Datasource
Jan 29, 2013 08:48 AM|LINK
Hello,
You xml is too complicated, and I did this demo for you:
I've changed your xml and it looks like this below:
m_coomer146
Member
37 Points
67 Posts
Re: RSS Datasource
Jan 29, 2013 02:45 PM|LINK
This is not my feed. all im trying to do is display a formated feed. only think I havent been able to figure out is how to get the image URL in the "media:content" node using RSSToolKit 2
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: RSS Datasource
Jan 30, 2013 12:04 AM|LINK
Not your feed?
I just fetch some of your feed codes and do a demo for you to tell you that you can fetch the xml node with the namespace like this.