XDocument
C#でLinq-to-XMLを使用して次のXMLを解析するのに問題があります。
<matches count="9">
<books count="4">
<book>
<key>books/batman_dark_knight_returns/frank_miller</key>
<title>Batman: The Dark Knight Returns</title>
</book>
...
</books>
<movies count="4">
<movie>
<key>movies/batman_tales_of_dark_knight/boy_kirklan</key>
<title>Batman: Tales of the Dark Knight</title>
</movie>
...
</movies>
<music count="1">
<album>
<key>music/dark_knight/hans_zimmer</key>
<title>The Dark Knight</title>
</album>
</music> </matches>
私の非常に間違ったコードのスニペットは
var data = from query in xmlFeed.Descendants("books")
select new Book
{
Title = (string)query.Element("book").Element("title"),
count = (string)query.Element("stickers").Element("sticker").Element("count")
};
searchListBox.ItemsSource = data;
リストボックスにバインドできる長いリストで本、映画、テレビ番組を返すこのようなxmlを解析する方法についてのヘルプはありますか?
ありがとう