Assuming an xml:
<pre lang="xml">
<xml version="1.0">
<Names>
<Name>Tarun</Name>
<Name>Yummy</Name>
<Name>Delicious</Name>
</Names>
</pre>
Load the Xml:
XmlDocument xmlDoc=new XmlDocument();
xmlDoc.Load("C:\MyXml.xml");
String[] myArray=new String[]{"Tarun","Yummy"};
foreach(XmlNode myXmlNode in xmlDoc.Childnodes)
{
for(int i=0;i<myarray.length;i++)>
{
if (myArray[i]==myXmlNode.value)
{
messagebox(myArray[i]);
}
}
}
Well its better to learn XPath if you want to go directly to Name node in the xml.
like specifying in this form:
String myXPath="/Names/Name";
XmlNodeList myNodesList=xmlDoc.SelectNodes(myXPath);
then replace top portion of the above for loop with this:
foreach(XmlNode myXmlNode in myNodesList)