I think anyone could run this code and see the problem. On the last
line, if you look at the content of the xB object in your debugger,
you'll see the "xmlns" attribute, even though it's removed in the
previous command. I've tried variations on this idea, like a while
(xB.Attribute("xmlns") != null). Can anyone tell me why the "xmlns"
attribute is not removed from this object?
xBlog is an <asp:Xml> object on the page. This code is in the
Page_Load event in a ASP.Net app using the 3.5 framework.
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(@"http://
charliescowboyblog.blogspot.com/feeds/posts/default");
HttpWebResponse response = (HttpWebResponse)req.GetResponse();
Stream stream = response.GetResponseStream();
StreamReader reader = new StreamReader(stream, Encoding.UTF8);
XElement xB = XElement.Parse(reader.ReadToEnd());
response.Close();
reader.Close();
xB.Attribute("xmlns").Remove();
xBlog.DocumentContent = xB.ToString();