using System;
using System.Xml;
namespace Project1
{
class Class
{
[STAThread]
static void Main(string[] args)
{
XmlDocument xmlDoc;
XmlNode xmlNode;
String xpathExpr;
xmlDoc = new XmlDocument();
xmlDoc.LoadXml( "<?xml version='1.0'?><root><person1><name>Martin Fowler</name></person1><person2><name>Kent Beck</name></person2><person3><name>Dave Astels</name></person3><xyz></xyz><abc></abc></root>" );
xpathExpr = "/root/person[name='Martin Fowler']";
xmlNode = xmlDoc.SelectSingleNode(xpathExpr);
Console.WriteLine(xmlNode.OuterXml);
Console.ReadLine()
}
}
}
in the above example, can I get the all person() nodes.Its nothing but person% concept using xpath or any other thing. Please help me.
!--removed tag-->
Enter your message below
Sign in or Join us (it's free).