【发布时间】:2009-01-15 22:27:28
【问题描述】:
我想知道用 LINQ 实现这个 xpath 查询的“最佳实践”方式(在 C# 中)是什么:
/topNode/middleNode[@filteringAttribute='filterValue']/penultimateNode[@anotherFilterAttribute='somethingElse']/nodesIWantReturned
我想要一个“nodesIWantReturned”的 IEnumerable 列表,但只能来自 XML 树的某个部分,具体取决于祖先属性的值。
【问题讨论】: