views:

18

answers:

1

Hello,

I am doing the following:

    System.Net.WebRequest myRequest = System.Net.WebRequest.Create("http://www.atlantawithkid.com/feed/");
System.Net.WebResponse myResponse = myRequest.GetResponse();

System.IO.Stream rssStream = myResponse.GetResponseStream();
System.Xml.XmlDocument rssDoc = new System.Xml.XmlDocument();
rssDoc.Load(rssStream);

System.Xml.XmlNodeList rssItems = rssDoc.SelectNodes("rss/channel/item");
System.Xml.XmlNode rssDetail;

// FEED DESCRIPTION

string sRssDescription; 
rssDetail = rssItems.Item(0).SelectSingleNode("description");
if (rssDetail != null)
    sRssDescription = rssDetail.InnerText;

But, when I read the "description" node and view the InnerText, or the InnerXML, the string is different than in the original XML document.

The string return has and ellipses and the data si truncated. However, in the original XML document there is data that I can see.

Is there a way to select this node without the data being altered?

Thanks for the help.

+1  A: 

I suspect you're looking at the string in the debugger, and that may be truncating the data. (Or you're writing it into something else which truncates text.)

I very much doubt that this is an XmlDocument problem.

I suggest you log the InnerText somewhere that you know you'll be able to get full data out, so you can tell for sure.

Jon Skeet
Yes, I did log the InnerText and it has the ellipses as well. I believe it has to do with something else, see other comment.
Tony
@Tony: I suggest you try to download the document as a string (e.g. using `WebClient.DownloadString`) and check there. Are you *sure* that it's not just the RSS feed truncating the full body?
Jon Skeet
Actually, I solved the problem this way:
Tony
System.Net.WebRequest myRequest = System.Net.WebRequest.Create("http://www.atlantawithkid.com/feed/"); System.Net.WebResponse myResponse = myRequest.GetResponse(); System.IO.Stream rssStream = myResponse.GetResponseStream(); XmlReader reader = new SyndicationFeedXmlReader(rssStream); SyndicationFeed feed = SyndicationFeed.Load(reader);
Tony
Turns out, that re-formats the RSS Feed and puts the data in a ElementExtension wrapped in CDATA tags. Thanks for the help!!
Tony