Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to prevent XElement from decoding character entity references
- string originalXML = @"<Description><data>Mark's Data</data></Description>"; //for illustration purposes only
- string encodedApostrophe = originalXML.Replace("'", "'");
- XElement xe = XElement.Parse(encodedApostrophe);
- originalXML.Replace("'", "'")
- XElement xe = XElement.Parse(originalXML);
- var data = xe.Element("data");
- data.Value = data.Value.Replace("'", "'");
Add Comment
Please, Sign In to add comment