My program is a HTML parser and it saves everything into XML file. The problem is when I'm trying open a file and read the text, it gives me for example:"NAME"
when it should be "NAME"
It seems that when I use .Replace(""", """)
It writes " as & ; quot ; once again. How should I handle it?
Edit:
It's <td> "IN QUOTE" BLA BLA BLA</td>
I do save this right here:
debt.Debtor.LegalPerson.Name = nazwa;
While debuging, the string I get is: "IN QUOTE" BLA BLA BLA
But when I write everything into XML
var serializer = new XmlSerializer(typeof(BGW_IMPORT));
serializer.Serialize(writer, bgw);
}
...
}
if (File.Exists(FilePath))
{
//XDocument existing;
XmlDocument ex = new XmlDocument();
XmlDocument docX = new XmlDocument();
using (FileStream fs = new FileStream(FilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None))
{
//existing = XDocument.Load(fs);
docX.LoadXml(doc.Document.ToString());
ex.Load(fs);
foreach (XmlNode wiersz in docX.SelectNodes("//Debt"))
{
XmlNode importNode = ex.ImportNode(wiersz, true);
ex.DocumentElement["Debts"].AppendChild(importNode);
}
}
File.Delete(FilePath);
using (FileStream fs = new FileStream(FilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None))
{
ex.Save(fs);
}...
At the end I get:
<Name>&quot;IN QUOTE&quot;BLA BLA BLA</Name>
When I want a:
<Name>"IN QUOTE"BLA BLA BLA</Name>