Im using YQL to get some data and here is my xml:
<?xml version="1.0" encoding="UTF-8"?>
<div id="content>
<div id="html">
<h3>City</h3>
<div id="movie">
<h4>
<a href="">movie 1</a>
</h4>
<div>
<div id="movie>
<h4>
<a href="">movie 2</a>
</h4>
</div>
.
.
.
<h3>City 2</h3>
<div id="movie">
<h4>
<a href="">movie 1</a>
</h4>
<div>
<div id="movie>
<h4>
<a href="">movie 2</a>
</h4>
</div>
I want to populate a listbox in my windows phone app with the city name and its movies like this:
City 1
Movie1
Movie 2
City 2
Movie1
Movie 2
However, I’m getting stuck here since all the XML is inside the div with id content.
How could a make a LINQ statement to solve this?
I tried to morph your posted input into some well-formed XML:
Then you can get a List with the code
[edit] Your initial request seemed to ask for a flat list result, your comment suggests you rather want a grouped structure so here is an adapted sample: