XMLTextWriter changing my variable in a URL (changes instances of & to &
Hoping to get an answer without posting a code example for now.
My program creates two files with the same exact information. A text file and an XML file.
There are several variable values and strings outputted to these files,one of which is a URL for a web page.
The text file, created using TextWriter outputs the correct values, including the URL.
The XML file that is created, in each instance where the string variable for the URL is placed, a substitution is made. Where there is supposed to be a literal &, XMLTextWriter is putting a &
I want to output the literal &
http://somedomain.com/xx/v=76&x=484231&y= and so on
http://somedomain.com/xx/v=76&x=484231&y and so on
I put a test in the code one line above the line that outputs the URL string, xmlWriter.WriteString(strTargetURL)
Debug.WriteLine(strTargetURL) and it correctly prints http://somedomain.com/xx/v=76&x=484231&y and so on
The very next line, xmlWriter.WriteString(strTargetURL) outputs the string with & instead of just the & http://somedomain.com/xx/v=76&x=484231&y and so on
It is driving me crazier than I already was.
Thanks
jbl
Hoping to get an answer without posting a code example for now.
My program creates two files with the same exact information. A text file and an XML file.
There are several variable values and strings outputted to these files,one of which is a URL for a web page.
The text file, created using TextWriter outputs the correct values, including the URL.
The XML file that is created, in each instance where the string variable for the URL is placed, a substitution is made. Where there is supposed to be a literal &, XMLTextWriter is putting a &
I want to output the literal &
http://somedomain.com/xx/v=76&x=484231&y= and so on
http://somedomain.com/xx/v=76&x=484231&y and so on
I put a test in the code one line above the line that outputs the URL string, xmlWriter.WriteString(strTargetURL)
Debug.WriteLine(strTargetURL) and it correctly prints http://somedomain.com/xx/v=76&x=484231&y and so on
The very next line, xmlWriter.WriteString(strTargetURL) outputs the string with & instead of just the & http://somedomain.com/xx/v=76&x=484231&y and so on
It is driving me crazier than I already was.
Thanks
jbl