F
Fred
Hello,
I am having a problem with a multiline string that I create from a byte
array (xml file). I am using StringBuilder and Ecoding the string to ASCII
(code below).
/ Upload the NameValueCollection.
byte[] responseArray =
myWebClient.UploadValues(xmlParser.GetXMLValue(nodePath + "RequestURL",
"requesturl"), "POST", myNameValueCollection);
// used to build entire input
StringBuilder sb = new StringBuilder();
string tempString = null;
string response = "";
tempString = Encoding.ASCII.GetString(responseArray);
sb.Append(tempString);
response = sb.ToString();
The response still is multi-line with the xml being cut off in elements.
Example:
..... <no
de1/>..... <element1>te
<element1/>
I have tried this code to remove carraige returns, new lines...
response = response.Replace("\r", "").Replace("\t", "").Replace("\n", "");
It removes these characters in the string but leaves the fragmented xml
string.
Any ideas?
I am having a problem with a multiline string that I create from a byte
array (xml file). I am using StringBuilder and Ecoding the string to ASCII
(code below).
/ Upload the NameValueCollection.
byte[] responseArray =
myWebClient.UploadValues(xmlParser.GetXMLValue(nodePath + "RequestURL",
"requesturl"), "POST", myNameValueCollection);
// used to build entire input
StringBuilder sb = new StringBuilder();
string tempString = null;
string response = "";
tempString = Encoding.ASCII.GetString(responseArray);
sb.Append(tempString);
response = sb.ToString();
The response still is multi-line with the xml being cut off in elements.
Example:
..... <no
de1/>..... <element1>te
<element1/>
I have tried this code to remove carraige returns, new lines...
response = response.Replace("\r", "").Replace("\t", "").Replace("\n", "");
It removes these characters in the string but leaves the fragmented xml
string.
Any ideas?