Partager via


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

'Declaration
Public Function GetAttribute ( _
    localName As String, _
    namespaceUri As String _
) As OpenXmlAttribute
'Usage
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

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.

See Also

Reference

OpenXmlElement Class

OpenXmlElement Members

DocumentFormat.OpenXml Namespace