2
如何使用Linq to XML查詢XML文檔以查找具有特定屬性的子節點,以便查找任意數量的子節點?找到一個具有特定屬性的子節點,用於任意數量的子節點?
如何使用Linq to XML查詢XML文檔以查找具有特定屬性的子節點,以便查找任意數量的子節點?找到一個具有特定屬性的子節點,用於任意數量的子節點?
你可能想考慮使用的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'