using (Stream str = System.IO.File.Open(@"fileName.xml", FileMode.Open)) { XmlReaderSettings p = new XmlReaderSettings { DtdProcessing = DtdProcessing.Parse }; using (XmlReader xr = XmlReader.Create(new StreamReader(str, Encoding.UTF8), p)) { XDocument xDoc = XDocument.Load(xr); // or //XElement xEl = XElement.Load(xr); //do your stuff here. } }
Aucun commentaire:
Enregistrer un commentaire