## XPathNavigator::GetAttribute method


返回具有指定本地名称和命名空间 URI 的属性的值。

```cpp
virtual String System::Xml::XPath::XPathNavigator::GetAttribute(String localName, String namespaceURI)
```


| Parameter | Type | 描述 |
| --- | --- | --- |
| localName | 字符串 | 属性的本地名称。**localName** 区分大小写。 |
| namespaceURI | 字符串 | 属性的命名空间 URI。 |

### ReturnValue

一个 [String](../../../system/string/)，其中包含指定属性的值；如果未找到匹配的属性，或 [XPathNavigator](../) 未定位在元素节点上，则为 [String::Empty](../../../system/string/empty/)。

## 另见

* Class [String](../../../system/string/)
* Class [XPathNavigator](../)
* Namespace [System::Xml::XPath](../../)
* Library [Aspose.Page for C++](../../../)
