I am making some validations in an xml and remove certain elements based on date fields the below LINQ will do the job just fine.
XDocument newXML = XDocument.Load(new StringReader(xmlValue)); var q = from node in newXML.Descendants("Date") let attr = node.Value where attr != null && DateTime.ParseExact (attr, "dd-MM-yyyy", CultureInfo.InvariantCulture)< DateTime.Today select node.Parent; q.ToList().ForEach(x => x.Remove());How can I check whether this linq has identified and removed the items? OR
How can I load the results of newXML as an xml document?
Manas MohapatraPosted Oct 31, 2016, 5:31 AM
Guest UserPosted Oct 31, 2016, 5:16 AM