My first XElement is:
XElement sourceFile = new XElement("source",
from o in Version1.Element("folder").Elements("folders").ElementAt(0).Elements("folder")
where o.Name != null && o.Name == "folder"
select new XElement("data",
new XElement("name",(string) o.Attribute("name")),
new XElement("filesCount", (string)o.Attribute("folderCount")),
new XElement("filesCount", (string)o.Attribute("filesCount"))
));
//,o)
My second is:
XElement targetFile = new XElement("target",
from o in Version2.Element("folder").Elements("folders").ElementAt(0).Elements("folder")
where o.Name != null && o.Name == "folder"
select new XElement("data",
new XElement("name", (string)o.Attribute("name")),
new XElement("filesCount", (string)o.Attribute("folderCount")),
new XElement("filesCount", (string)o.Attribute("filesCount"))
));
I'd like to find the delta (the source always contains the target) something like this... sadly my is not working:
XElement nodenotinsource = new XElement ("result",
from y in sourceFile.Elements().Except(from o in targetFile.Elements())
select new XElement("ttt", y.Element("name").Value));
Version1 and Version2 were created like this:
XElement Version1 = XElement.Load(@"C:\output\xmltestO.xml");
XElement Version2 = XElement.Load(@"C:\output\xmltestO.xml");
where the two files are the same except the change the program should find...