XElement root = XElement.Load("data.xml");
var answers = root.CreateNavigator().Select("/Category/Subject/Question/Answer");
Then I loop through each answer...
while (answers.MoveNext())
{
Here I convert the underlying object to an Element to get the values:
var details = answers.Current.UnderlyingObject as XElement;
Now I can access the elements I want:
var val = details.Element("Description").Value;
}
No comments:
Post a Comment