Yeah, I know, I tried that solution. The problem is that other people keep
on updating the config files with new URLs and not replacing "&" with
"&" ..
Anyway, I figured out the answer ;
use XmlNode.InnerText instead of XmlNode.InnerXml
"The Other Nice Man" <ot**********@gmail.com> wrote in message
news:11*********************@z34g2000cwc.googlegro ups.com...
I am going to assume your are talking about the & character in the URL.
The & character is only used as an escape character within xml and
needs to be replaced with & to be legal.
Your sample URL becomes
<Element1>http://overthetop.com?search=too%20much&sort=populati ty</Element1>,
which is valid XML and cam be used as is for hyperlinks.
Here is some sample code to replace & in a URL with &
public static void ReplaceRegex()
{
// Regex search and replace
RegexOptions options = RegexOptions.None;
Regex regex = new Regex(@"&", options);
string input =
@"http://overthetop.com?search=too%20much&sort=populatity";
string replacement = @"&";
string result = regex.Replace(input, replacement);
// TODO: Do something with result
System.Windows.Forms.MessageBox.Show(result, "Replace");
}