我正在尝试使用 LINQ 从 ATOM 提要中的作者节点中选择“名称”字段。我可以像这样获得我需要的所有字段:
XDocument stories = XDocument.Parse(xmlContent);
XNamespace xmlns = "http://www.w3.org/2005/Atom";
var story = from entry in stories.Descendants(xmlns + "entry")
select new Story
{
Title = entry.Element(xmlns + "title").Value,
Content = entry.Element(xmlns + "content").Value
};
在这种情况下,我将如何选择作者-> 姓名字段?