Vic
unread,Nov 21, 2009, 5:00:16 PM11/21/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
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();