Find Element
-
Hi, I have many entries in my XML and I would like to search for one in particular (the one the user wants) but not show it, just take that entry and check an element in it, how would this be done. Ex: KABE Allentown Intl PA 40.652364 -75.440403 KABI Abilene Reg. TX 32.411319 -99.681897 I want to look up KABE and put its Long value in a double. (BTW, I have no schema for this file, only the XML, would a schema be helpfull here?) Thanks... // JS Paquet cout << "Thank you all" << endl;
-
Hi, I have many entries in my XML and I would like to search for one in particular (the one the user wants) but not show it, just take that entry and check an element in it, how would this be done. Ex: KABE Allentown Intl PA 40.652364 -75.440403 KABI Abilene Reg. TX 32.411319 -99.681897 I want to look up KABE and put its Long value in a double. (BTW, I have no schema for this file, only the XML, would a schema be helpfull here?) Thanks... // JS Paquet cout << "Thank you all" << endl;
Try something like:
XmlNode node = doc.SelectSingleNode("/Airports/Airport[ICAO='KABE']/Long");
double lon = double.Parse(node.InnerText);
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer