Question : How to get Full XML node name using C#

Suppose I have an XML file of the form

   
       
       
     



If I get an XMLNode (say eee), the name property will be eee;

but if I want to get the full path of the node ; like aaa | bbb | eee (the seperator can be customized later) is there  any way I can retrieve the FULL PATH STRING  from an XMLNode(like eee)?

Answer : How to get Full XML node name using C#

Well, it can be done by code, but what if you have:

   
       
       
       
       
     



You have several aaa.bbb.eee

That string is not unique... (Unlike full path in tree node).


XmlNode has a property called ParentNode
And each XmlNode has a Name.
So if you do a loop and create a string of the names, separated  by | or \ then you can have the full path
(You do the loop until ParentNode == Null)
Random Solutions  
 
programming4us programming4us