how to check if xml node is the root in asp.net
I 开发者_JAVA百科made a algorithm that read from xml and this algorithm need to check if we are in the root node.
How can I check the node level in asp.net?
Thanks for any help
Baaroz
Try the following code with System.Xml namespace :
XmlDocument xDoc = new XmlDocument();
xDoc.Load(_url);
XmlNode root = xDoc.FirstChild;
if (root.Name.ToLower() == "rss")
{
//perform your logic
}
Hope this helps..
精彩评论