|
|
|
Forum Member
Group: Forum Members
Last Login: 12/4/2003 11:30:00 AM
Posts: 6,
Visits: 1
|
|
I might be missing something really obvious, but in BlogItem is seems I am getting a string that is not in any XML format. For example, I get channelTitlelinkchanneldescriptionIndustry unites against drunk dogs... as one big ugly string. Here is the code I am using to see this string XPathNavigator xnav = rssFragment.CreateNavigator (); MessageBox.Show(xnav.Value );MessageBox.Show(xnav.XmlLang ); MessageBox.Show(xnav.ToString() ); Ideas???
|
|
|
|
|
NewsGator
Group: Administrators
Last Login: 9/2/2008 2:11:41 PM
Posts: 1,084,
Visits: 35
|
|
You're seeing expected behavior for what you're doing...but what you WANT to be doing is something like the following: XPathNavigator nav = rssFragment.CreateNavigator();
XPathNodeIterator iterator = nav.Select("/rss/channel/item/description"); while (iterator.MoveNext()) { description = iterator.Current.Value; } iterator = nav.Select("/rss/channel/item/title"); while (iterator.MoveNext()) { title = iterator.Current.Value; } That should get you started...
|
|
|
|
|
Forum Member
Group: Forum Members
Last Login: 12/4/2003 11:30:00 AM
Posts: 6,
Visits: 1
|
|
Yep starting from the root did the trick. Thanks. NewsGator Rocks! I simply love it. I assume most of the Outlook related code you have is COM, right?
|
|
|
|
|
Forum Member
Group: Forum Members
Last Login: 12/4/2003 11:30:00 AM
Posts: 6,
Visits: 1
|
|
One more question and it is probably as obvious as the first... Why do these simple return "channelTitle" and "channelLink"? iterator = xnav.Select("/rss/channel/title"); while (iterator.MoveNext()) { string link = iterator.Current.Value; MessageBox.Show(link); } iterator = xnav.Select("/rss/channel/link"); while (iterator.MoveNext()) { string link = iterator.Current.Value; MessageBox.Show(link); }
|
|
|
|
|
NewsGator
Group: Administrators
Last Login: 9/2/2008 2:11:41 PM
Posts: 1,084,
Visits: 35
|
|
Cool, glad it's working better now. And I'm glad you like NewsGator!
|
|
|
|
|
NewsGator
Group: Administrators
Last Login: 9/2/2008 2:11:41 PM
Posts: 1,084,
Visits: 35
|
|
On the channel title and link, NewsGator doesn't actually store channel information for the items, so it doesn't have anything useful to put in those items. They are, however, required by the RSS 2.0 spec. In this case, you should just ignore them. If you have a scenario where you think you need this information, let me know so we can see if there's some way to handle it, or if there's a good use case to start providing this information.
|
|
|
|
|
Forum Member
Group: Forum Members
Last Login: 12/4/2003 11:30:00 AM
Posts: 6,
Visits: 1
|
|
| What I am looking for is the link to the article. I am storing the date, title, my comments and link to the original post in a database so I can search for it.
|
|
|
|
|
NewsGator
Group: Administrators
Last Login: 9/2/2008 2:11:41 PM
Posts: 1,084,
Visits: 35
|
|
Gotcha. The only way to do this right now would be to parse the link out of the description - we will always put it in there, in the same format, so you should be able to parse it out. In the next release, this information will be provided directly.
|
|
|
|
|
Forum Member
Group: Forum Members
Last Login: 12/4/2003 11:30:00 AM
Posts: 6,
Visits: 1
|
|
| Right. Thanks for all your help. I will parse it out and wait for the new version.
|
|
|
|