I am deserializing an opml file which has one outline with more outlines inside it. Like:
<outline text="Stations"...>
<outline.../>
<outline.../>
.....
</outline>
After this there are more singular outlines:
<outline/>
<outline/>
Now I want to deserialize only the outlines inside the "Station" outline. If I use direct Xml.Deserializer it always includes all the outlines.
I have a class Outline as follows:
public class Outline
{
public string Text { get; set; }
public string URL { get; set; }
}
I am using Restsharp to get a response like this:
RestClient client = new RestClient("http://opml.radiotime.com/");
RestRequest request = new RestRequest(url, Method.GET);
IRestResponse response = client.Execute(request);
List<Outline> outlines = x.Deserialize<List<Outline>>(response);
I get the response successfully, no problems there but I want only data from inside the "Station" outline.
How do I do this? How do I select the "Stations" outline?
I have tried to deserialize using this class:
public class Outline
{
public string Text { get; set; }
public string URL { get; set; }
public Outline[] outline {get; set;}
}
but this doesn't work because only one Outline has more outlines inside it. Also I can't simply remove outlines from the List because there values and names alter.
What I want is that somehow the "Station" outline is selected "before" the deserializing and then it parses the rest of the outlines inside it. How do I achieve this?
This is the url for the opml data: http://opml.radiotime.com/Browse.ashx?c=local
Thank you for your help!