retrieving element names

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
How do you create a linq query to retrieve element names?
My query looks like this
<pre class="prettyprint KeyValuePair<string, string> charInfo = from character in doc.Elements("Folder").Elements("Characters").Elements("Character")
where character.Attribute("name").Value == charName
select character.Elements().[/code]
<br/>
this is incomplete. Im trying to figure out two things here - one, how to populate into a KeyValuePair, and two, how to retrieve the element names?
charInfo should end up having the element name (ie. "hair color", "number of siblings", etc.) in the left hand side and the actual data (ie. "blonde", "3", etc.) in the right hand side.
help please

View the full article
 
Back
Top