XPathDocument Doc = new XPathDocument(@"c:\b.xml");
XPathNavigator nav = Doc.CreateNavigator();
XPathNodeIterator Iterator = nav.Select("/ITPL/GATE/SLOT[@STATUS='1']");
while (Iterator.MoveNext())
{
XPathNavigator nav1=Iterator.Current;
nav1.MoveToAttribute("SNO","");
Console.WriteLine("SLOTNO {0}",nav1.Value);
nav1.MoveToNextAttribute();
Console.WriteLine("TYPE {0}",nav1.Value);
}
The above code is displaying the SLOT attributes(and their value).I want
the parent "Gate" to be displayed too alongwith its attributes.How can i do
it?(The xml file is being referred in this dicussion)
--
Message posted via http://www.dotnetmonster.com