取得索引器,用來擷取符合指定展開名稱之目前專案的所有子代專案。
語法
elem.Descendants[{namespaceName}localName]
屬性值/傳回值
型別的索引器 IEnumerable<XElement> Item(String expandedName)
。 這個索引器會採用指定子代專案的展開名稱,並傳回 IEnumerable<
XElement>
集合中相符的子專案。
言論
這個屬性相當於 XContainer 類別的 System.Xml.Linq.XContainer.Descendants(XName) 方法。
傳回集合中的元素是 XML 源文件順序。
這個屬性會使用延後執行。