XElementExtensions.GetAttribute method
Version 1.1.28
.NET Framework 4.8
Namespace | Skybrud.Essentials.Xml.Extensions |
---|---|
Assembly | Skybrud.Essentials.dll |
GetAttribute(XElement, XName)
Extension method
Gets the first attribute matching the the specified name
.
public static XAttribute GetAttribute(this XElement element, XName name)
Parameters
Returns
An instance of XAttribute , or null
if no attributes were matched.
GetAttribute(XElement, string)
Extension method
Gets the first attribute matching the the specified XPath expression
.
public static XAttribute GetAttribute(this XElement element, string expression)
Parameters
expression
String
The XPath expression to match.
Returns
An instance of XAttribute , or null
if no attributes were matched.
GetAttribute(XElement, string, IXmlNamespaceResolver)
Extension method
Gets the first attribute matching the the specified XPath expression
.
public static XAttribute GetAttribute(this XElement element, string expression, IXmlNamespaceResolver resolver)
Parameters
expression
String
The XPath expression to match.
resolver
IXmlNamespaceResolver
An instance of IXmlNamespaceResolver for the namespace prefixes in the XPath expression.
Returns
An instance of XAttribute , or null
if no attributes were matched.