public XDocument Load(string filename) { XDocument doc = null; try { doc = XDocument.Load(filename, LoadOptions.SetBaseUri | LoadOptions.SetLineInfo); } catch (XmlException e) { Report.Verbose(0, "Exception: {0}", e); Report.Warning(0, Report.WarningParser + 0, e, "Invalid XML file '{0}': {1}", filename, e.Message); } return(doc); }
public XmlDocument Load(string filename) { XmlDocument doc = new XmlDocument(); try { doc.Load(filename); } catch (XmlException e) { Report.Verbose(0, "Exception: {0}", e); Report.Warning(0, Report.WarningParser + 0, e, "Invalid XML file '{0}': {1}", filename, e.Message); doc = null; } return(doc); }