Im using c#.net windows form application. I have a xml file that contains many nodes. Some nodes have same names. I want to display these nodes in a tree view. For that what i think is to get all node names into a list. Compare if the node already exits
and display only unique names into a tree view.My xml file is given below:
-
-
abc
hello how ru
-
def
i m fine
-
ghi
how abt u
Here i need to display only:
languages
language
key
value.
Similarly if there are any other nodes with different names, I need to display them
Please help me.
解决方案Which version of .NET do you use? With .NET 3.5 or later you could use LINQ to XML to find unique nodes.
I am also not sure why are mentioning both a list and a tree view. A tree view is hierarchical, a list is flat. As for the unique names you want to find, does that apply to the whole document? Or only to the child elements of each element?