By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,558 Members | 1,177 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,558 IT Pros & Developers. It's quick & easy.

Problem with xml response

P: 16
I'm developing an application which communicate with a web service to get xml response. The problem is the response not well formed xml. The start of the document appears like below.

"<?xml version=\"1.0\" encoding=\"utf-8\" ?>

I need to remove the "\" characters and starting " from this document to make it well formed. I use the below code.

HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();

Stream responseStream = httpWebResponse.GetResponseStream();
Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
StreamReader readStream = new StreamReader( responseStream, encode );
string tempString = readStream.ReadToEnd().Replace("\\","").Replace("\ n", "").Replace("\r", "").Replace("\t", "");


But still cannot get the required output. Can anyone help to solve this?
Apr 23 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.