이 보이는
allPosts = (from x in feed.Descendants("item")
select new blogPost
{
Creator = (string)x.Element("creator"),
Title = (string)x.Element("title"),
Published = DateTime.Parse((string)x.Element("pubDate")),
Content = (string)x.Element("content"),
Description = (string)x.Element("description"),
Link = (string)x.Element("link"),
}).ToList<blogPost>();
감사합니다. 콘텐츠는 인코딩 된 요소와 연결된 XML Namespace입니다.
XNamespace contentNS = "<whatever the namespace is>";
allPosts = (from x in feed.Descendants("item")
select new blogPost
{
Creator = (string)x.Element("creator"),
Title = (string)x.Element("title"),
Published = DateTime.Parse((string)x.Element("pubDate")),
// Looking for content:encoded
Content = (string)x.Element(contentNS + "encoded"),
Description = (string)x.Element("description"),
Link = (string)x.Element("link"),
}).ToList<blogPost>();
contentNS의 값은 원래의 XML의 존재에 따라 달라집니다
이하는 XMLNS을 찾아보십시오 : 당신이 필요한 것은 그것을 위해 적절한 XNamespace를 정의하고 쿼리에 추가되는 콘텐츠 정의 루트 요소.
RSS 피드를 가르쳐 주시겠습니까? 또한 다음과 같은 RSS 유효성 검사기를 통해 실행할 수도 있습니다. http://www.rssboard.org/rss-validator/ –