With my code below, I can load one Xml file into XmlDocument xWorkload.
XmlDocument xWorkload = new XmlDocument();
private void button1_Click(object sender, RoutedEventArgs e)
{
var outputxml = new StringBuilder(string.Empty);
Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
dlg.FileName = "demo";
dlg.DefaultExt = ".xml";
dlg.Filter = "Xml documents (.xml)|*.xml";
var result = dlg.ShowDialog();
if (result == true)
{
xWorkload.Load(dlg.FileName);
string Path = dlg.FileName.Replace(dlg.SafeFileName, "");
}
}
Suppose that there is more than one Xml file in a folder, and I want to load all the Xml files into xWorkload and store these XML files in a line. How to do this? This can be done in wpf using only XmlDocument (Not Linq). Plz suggest
source
share