【发布时间】:2013-08-25 07:29:09
【问题描述】:
我想从this XML 中提取字段yt:username:
var xDoc = XDocument.Load(requestedURL);
var m_oListaMeteo = xDoc.Descendants(ns + "entry").Select(n =>
{
return new
{
username = n.Element(ns + "yt:username").Value
};
});
但XDocument 本身说The ':' character, hexadecimal value 0x3A, cannot be included in a name.
需要字符串替换吗?还是需要我管理 youtube 的命名空间?
【问题讨论】:
标签: c# .net namespaces linq-to-xml deserialization