时间:2010-07-26 16:03:50

标签: .net xml xpath linq-to-xml

1 个答案:

答案 0 :(得分:1)

您可能想考虑使用 XPath ..

XmlNodeList list = xmlDoc.SelectNodes("//nodeType[@attrName=attrValue]");

//This selects all elements of type 'nodeType' occuring anywhere in the document 
//having 'attrName' attribute of value 'attrValue'