获取一个索引器,该索引器用于检索与指定扩展名对应的属性实例。
语法
elem.Attribute[{namespaceName}attribName]
属性值/返回值
一个类型为 XAttribute Item(String expandedName) 的索引器。此索引器获取指定属性的扩展名,然后返回相应的 XAttribute,如果没有具有指定名称的属性,则返回 null。
注释
此属性等效于 System.Xml.Linq.XElement 类的 Attribute 方法。
获取一个索引器,该索引器用于检索与指定扩展名对应的属性实例。
elem.Attribute[{namespaceName}attribName]
一个类型为 XAttribute Item(String expandedName) 的索引器。此索引器获取指定属性的扩展名,然后返回相应的 XAttribute,如果没有具有指定名称的属性,则返回 null。
此属性等效于 System.Xml.Linq.XElement 类的 Attribute 方法。