I have written a code which escape special characters in XML while posting an XML Request. Here is the sample code sample.
private string EscapeXMLillegalCharacters (string strValue){return strValue.Replace("&", "&").Replace("'", "'").Replace("\"", """).Replace("<", "<").Replace(">", ">");}
Hope this is useful. Happy coding
Instead of reinvesting the wheel you should write
ReplyDeletestring encodedXml = System.Security.SecurityElement.Escape(xml);
Yes we can do with what you have suggested. What i did was for the older versions. Thanks and appreciated
Delete