Click here to Skip to main content
15,665,319 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:

I want to get the list of attributes a node is having, for eg -
<ContentNode type="ApplicationProcess" name="Sub App Process2" navigate_url="" tag="c2532e51-704f-45e9-abc7-f8a2a7b1f425">

Here the attributes are type, name, navigate_url and tag so I need to get these attribute names to be populated in a drop down, so can anyone suggest what can be done?

Thanks in advance,

Actually this is a extra thing which i am adding to my application.I want to get the list of attributes to populated in a dropdown based on the node selected, so can anyone help me with that?
Updated 13-Dec-11 18:00pm
Amir Mahfoozi 13-Dec-11 7:09am    
What did you do so far ?
Sergey Alexandrovich Kryukov 13-Dec-11 8:43am    
How do you parse XML? that, doesn't MSDN tells you all the API?

Share this answer
XmlNodeList list = doc.SelectNodes("//*");
XmlAttributeCollection attrlst;
foreach (XmlNode n1 in list)
string str =n1.Attributes["name"].Value;
attrlst = n1.Attributes;

foreach (XmlAttribute att in attrlst)

string ite = att.Name;

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900