XmlWriter.WriteRaw will preserve ' and not send an actual apostrophe. Is there a method to read in ' and keep it as such?
XmlWriter.WriteRaw will preserve ' and not send an actual apostrophe. Is there a method
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to encode it properly. Let’s take for example the following XML:
The value of the
<root>node is'no matter which XML parser you use to read this XML.On the other hand if you have the following XML:
the value of the
<root>node is'.So in both cases we have properly encoded XML so that when a standard compliant parser reads it, it is able to correctly retrieve the value.
So be very careful when using the
WriteRawmethod when generating the XML. Since it properly encode the argument it is now your responsibility to ensure that you are passing correct data to it.