I am converting the xml file which has got html entity names to html decimals. After conversion, I need to save that file in a different folder. XMLMakeSafe is converting the html entity names to decimals(≥ is converted to ≥ which is fine and needed)
. But the XDocument.Parse is converting the html decimals to symbols which I do not want. Without converting to symbols I want to save the file. Could there be anyway of saving the file without conversion to symbols through XDocument.Parse or is there any
other way
var fileText = string.Empty;
using (FileStream fileStream = fileIn.OpenRead())
{
fileText = new StreamReader(fileStream).ReadToEnd();
}
var topicStart = fileText.IndexOf("<topic);
var xml = fileText.Substring(topicStart);
var unsafeXML = string.Format("{0}{1}", header.ToString(), xml);
var safeXML = XMLMakeSafe(fileText); //This conversion is successful
var xdoc = XDoc ...
Go to the complete details ...