任何人都知道为什么这个XPath表达式"catzero/@id"
不工作在这个xml问题阅读的XElement属性
document = XDocument.Load("file.xml");
var product = document.XPathSelectElements("//product", nameSpaceResolver).First();
var category = ((IEnumerable) product.XPathEvaluate("catzero/@id")).Cast<XAttribute>().first().value; //catezero/@id is null
请给出一些示例代码并解释发生了什么 - “不工作”不是很具描述性。 – 2010-01-09 13:51:07
好吧好吧.. – h3n 2010-01-12 01:16:29