私の前の質問(http://stackoverflow.com/questions/7817619/unknown-error-using-digg-api-and-uri-handler-silverlight、答えてくれてありがとう)から続けて、私は今フォローしていますエラーの少ない質問をアップします。
これからデータを抽出するために、次のXMLからLINQへのコードを取得しました。
var stories = from story in document.Descendants("story")
//where story.Element("thumbnail") != null
select new DiggStory
{
Id = (string)story.Attribute("story_id"),
Title = (string)story.Element("title"),
Description = (string)story.Element("description"),
ThumbNail = (string)story.Element("thumbnail").Attribute("src"),
//HrefLink = (string)story.Attribute("permalink"),
NumDiggs = (int)story.Attribute("diggs")
};
これは意図したとおりに機能しますが、Digg APIが古くなっているので、次のXMLファイルを作成する新しいAPIを使用したいと思います。
この新しいXMLファイルを利用するためにXMLをLINQコードに調整するにはどうすればよいのでしょうか。私は問題がにあることを知っています
var stories = from story in document.Descendants("story")
しかし、新しいXMLファイルにはより多くのレベルがあるため、何に変更する必要があるのかわかりません。私は次のようなことを考えていました
var stories = from item in document.Descendants("stories")
しかし、それはうまくいかないようです。
この問題とそれ以上の問題について私を助けてくれてありがとうございます。これは本当に素晴らしいウェブサイトです!
ありがとう、トーマス