Borsec
asked on
problem with & in xml document
I have a problem while tried to deserialize a XML file that contains a special character '&'. The error message is “An error occurred while parsing EntityName. Line 14, position 40.”
public static CSettings ReadSettings()
{
CSettings ob = null;
xmlFile = Path.Combine(CDCPath.LocalSystemConfig, SETTINGS_FILE_NAME);
if (System.IO.File.Exists(xmlFile))
{
Stream stream = new FileStream(xmlFile, FileMode.Open, FileAccess.Read, FileShare.Read);
System.Xml.XmlReader streamReader = System.Xml.XmlReader.Create(stream);
System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer
(typeof(CSettings));
ob = (CSettings)serializer.Deserialize(streamReader);
stream.Close();
}
return ob;
}
can u post the xml?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks! The problem is solved.
You're right, I found an simple '&' in my XML file.
You're right, I found an simple '&' in my XML file.
Great. Please mark this question as answered :)