XDocument : is it possible to force the load of a malformed XML file?
问题 I have a malformed XML file. The root tag is not closed by a tag. The final tag is missing. When I try to load my malformed XML file in C# StreamReader sr = new StreamReader(path); batchFile = XDocument.Load(sr); // Exception I get an exception " Unexpected end of file has occurred. The following elements are not closed: batch. Line 54, position 1. " Is it possible to ignore the close tag or to force the loading? I noticed that all my XML tools ((like XML notepad) ) automaticly fix or ignore