Priya Pated

Priya Pated

  • NA
  • 10
  • 0

read file using xmlreader and xpath

Feb 16 2011 8:27 AM

I am reading a XML file ,

XmlDocument objectTemporaryDocument = new XmlDocument();

objectTemporaryDocument.Load(

stringPathOfFile);

XmlNodeList objContentXmlNode = objectContentDocument.SelectNodes("/Root/Section");
foreach (XmlNode objInternalPages in objContentXmlNode)
{
XmlNode xmlNodeSettings = objInternalPages.SelectSingleNode("SubSection");
if (xmlNodeSettings != null)
{
stringModuleOverviewAlignment = xmlNodeSettings.Attributes["AttributeVal1"].Value;
stringGlobalDate = xmlNodeSettings.Attributes["AttributeVal2"].Value;
}
}

Which is giving required values and results..,But xml document is very big in size
so taking more time.

Can anyone tell me how to achive this using XPATH and XmlReader

thanks in advance
Priya

Answers (1)