i am retrieving data from guardian web service using c#. The answer i get is the xml string which is something like this
< results >
< content >
< fields >
< field name="headlines"> This is headline < /field>
< field name="text"> This is text < /field>
<field name="url"> This is url < /field>
< fields>
< /content>
< content>
.........
< /content>
....
< results>
The problem is that all the nodes having data have same name that is "field". When i use this code it return the data from the first field node but I want the data from the field named text.
var head = xmlStories.Root.Descendants("fields").Select(results => new
{
Text = results.Element("field").Value,
}).ToList();
foreach (var results in head)
{
text [h] = results.Text;
h = h + 1;
}