public static void LoadXmlFile( System.IO.TextReader reader, DomDocument document) { if (reader == null) { throw new ArgumentNullException("reader"); } if (document == null) { throw new ArgumentNullException("document"); } DomDocument tempDoc = LoadXmlFileWithCreateDocument(reader, document); if (tempDoc != null) { //string txt = tempDoc.GetDebugText() ; //System.Windows.Forms.MessageBox.Show(txt); document.CopyContent(tempDoc, true); document.AfterLoad(FileFormat.XML); //txt = txt + "\r\n------------\r\n" + document.GetDebugText(); //System.Windows.Forms.MessageBox.Show(txt); } else { //System.Windows.Forms.MessageBox.Show("Load NULL"); } }
public static void LoadXmlFile( System.IO.Stream stream, DomDocument document) { if (stream == null) { throw new ArgumentNullException("stream"); } if (document == null) { throw new ArgumentNullException("document"); } DomDocument doc = LoadXmlFileWithCreateDocument(stream, document); if (doc != null) { document.CopyContent(doc, true); document.AfterLoad(FileFormat.XML); } }
public static void LoadXmlFile( string fileName, DomDocument document) { if (fileName == null) { throw new ArgumentNullException("fileName"); } if (System.IO.File.Exists(fileName) == false) { throw new System.IO.FileNotFoundException(fileName); } if (document == null) { throw new ArgumentNullException("document"); } DomDocument doc = LoadXmlFileWithCreateDocument(fileName, document); if (doc != null) { document.CopyContent(doc, true); document.AfterLoad(FileFormat.XML); } }