OpenXmlElement.GetAttribute method

Office 2013 and later

Gets an Open XML attribute with the specified tag name and namespace URI.

Namespace:  DocumentFormat.OpenXml
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

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 with local name equal to "localName" and namespace URI equal to "namespaceUri".

ExceptionCondition
ArgumentOutOfRangeException

When the "localName" is empty.

KeyNotFoundException

When the element does not have the specified attribute.

Show: