开发者

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..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜