Freigeben über


OpenXmlElement.GetAttribute-Methode

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
)

Parameter

Rückgabewert

Typ: DocumentFormat.OpenXml.OpenXmlAttribute
Returns a clone of the OpenXmlAttribute which local name is "localName" and namespace URI is "namespaceUri".

Ausnahmen

Ausnahme Bedingung
ArgumentOutOfRangeException

When the "localName" is emtpy.

KeyNotFoundException

When the element does not have the specifed attribute.

Siehe auch

Referenz

OpenXmlElement Klasse

OpenXmlElement-Member

DocumentFormat.OpenXml-Namespace