cenOcr = new DataSet();
// Create the XmlSchemaSet class.
XmlSchemaSet sc = new XmlSchemaSet();
// Add the schema to the collection.
sc.Add(null, Application.StartupPath + "\
\APCenSchema.xsd");
sc.Compile();
XmlReaderSettings cenSettings = new XmlReaderSettings();
cenSettings.Schemas.Add(sc);
cenSettings.ValidationType = ValidationType.Schema;
cenSettings.ValidationEventHandler += new
ValidationEventHandler(cenSettingsValidationEventHandler);
DirectoryInfo dir = new DirectoryInfo(strPathname);
foreach (FileInfo f in dir.GetFiles("*.xml"))
{
/*
* Load XML files into dataset
*
*/
XmlReader ocrResults = XmlReader.Create(f.FullName,
cenSettings);
cenOcr.ReadXml(ocrResults);
}
I have try many differen methods. I tried using the
XmlReadMode.ReadSchema but this did not load any data into the
dataset.
Regards
Phil
I have managed to reduce my 3 minutes to 17 seconds. I read in all the
xml files one at a time, output a temporary xml file containing all
the xml. I then read that file into my dataset.
Regards
Phil