I have a need to search through an xml file, find a data set, examine a second xml file, check if there is related data, and then move on to the next data set.
Here's some sample code to illustrate:
XmlReader XmlDoc1 = XmlReader.Create("~/data/xml/myxml1.xml",settings);
XmlReader XmlDoc2= XmlReader.Create("~/data/xml/myxml2.xml",settings);
using (XmlDoc1) {
XmlDoc1.Open();
//get a data node
using(XmlDoc2){
XmlDoc2.Open();
//find related information... if it's there
XmlDoc2.Close();
}
//do stuff
XmlDoc1.Close();
}
I'm pretty sure the above code would produce an error, but it would be too time consuming to read XmlDoc1, get a data set, close it, search XmlDoc2, close it... wash, rinse, repeat. So, I'm looking for a speedy way to accomplish the above.
Before you ask, I cannot run a DB on this site, so XML will have to suffice.