共用方式為


Attribute (XElement 動態屬性)

取得用於擷取對應於指定擴充名稱之屬性執行個體的索引子 (Indexer)。

語法

elem.Attribute[{namespaceName}attribName]

屬性值/傳回值

XAttribute Item(String expandedName) 型別的索引子。 如果沒有具有指定之名稱的屬性,這個索引子會採用指定之屬性的擴充名稱,並傳回對應的 XAttributenull

備註

這個屬性等同於 Attribute 類別的 System.Xml.Linq.XElement 方法。

另請參閱