KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I would like to traverse every element and attribute in an xml and grab the name an value without knowing the names of the elements in advance. I even have a book on linq to xml with C# and it only tells me how to query to get the value of elements when I already know the name of the element. The code below only gives me the most high level element information. I need to also reach all of the descending elements. XElement reportElements = null; reportElements = XElement.Load(filePathName.ToString()); foreach (XElement xe in reportElements.Elements()) { MessageBox.Show(xe.ToString()); }
Tags (comma-separated)
Save Edits
Cancel