OpenXmlElement.GetAttribute Method
Gets a Open XML attribute with the specifed tag name and namespace URI.
Namespace: DocumentFormat.OpenXml
Assembly: DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)
Syntax
'Декларация
Public Function GetAttribute ( _
localName As String, _
namespaceUri As String _
) As OpenXmlAttribute
'Применение
Dim instance As OpenXmlElement
Dim localName As String
Dim namespaceUri As String
Dim returnValue As OpenXmlAttribute
returnValue = instance.GetAttribute(localName, _
namespaceUri)
public OpenXmlAttribute GetAttribute(
string localName,
string namespaceUri
)
Parameters
- localName
Type: System.String
The tag name.
- namespaceUri
Type: System.String
The namespace URI.
Return Value
Type: DocumentFormat.OpenXml.OpenXmlAttribute
Returns a clone of the OpenXmlAttribute which local name is "localName" and namespace URI is "namespaceUri".
Exceptions
Exception | Condition |
---|---|
ArgumentOutOfRangeException | When the "localName" is emtpy. |
KeyNotFoundException | When the element does not have the specifed attribute. |