I have a set of XML files that I load into XDocuments, adjust some data and save.
The original document has the following as the first line
once saved this becomes
<?xml version="1.0" encoding="UTF-8"?>
I then SFTP these files to another application that parses them. Unfortunately this now causes a XML -1072896682 error.
I used to do this conversion via a perl script using XML::LibXML which gave me no issues.
Does anyone know how I can save the XDocument without adding this extra information.
var doc = XDocument.Load(file);
var q1 = from c in doc.Elements("meeting")
foreach (XElement date in q1)
date.Attribute("meetingdate").Value = meetingDate;
var q2 = from c in doc.Elements("meeting").Elements("races").Elements("race")
foreach (XElement date in q2)
date.Attribute("racedate").Value = meetingDate;
doc.Save(Path.Combine(ver4Directory, "Ver4_" + fileNameDate + "_" + key));