XElementExtensions.GetElements method
Namespace | Skybrud.Essentials.Xml.Extensions |
---|---|
Assembly | Skybrud.Essentials.dll |
GetElements(XElement, XName)
Gets an array of XElement matching the specified name
.
public static XElement[] GetElements(this XElement element, XName name)
Parameters
GetElements<T>(XElement, XName, Func<T, TResult>)
Gets an array of XElement matching the specified name
and parses each element using callback
.
public static T[] GetElements<T>(this XElement element, XName name, Func<T, TResult> callback)
Type Parameters
T
The type of the items to be returned.
Parameters
A callback function for parsing the element.
Returns
T
The elements as parsed by the specified callback
.
GetElements(XElement, string)
Gets an array of XElement matching the specified expression
.
public static XElement[] GetElements(this XElement element, string expression)
GetElements(XElement, string, IXmlNamespaceResolver)
Gets an array of XElement matching the specified expression
.
public static XElement[] GetElements(this XElement element, string expression, IXmlNamespaceResolver resolver)
Parameters
expression
String
The XPath expression.
resolver
IXmlNamespaceResolver
An instance of IXmlNamespaceResolver for the namespace prefixes in the XPath expression.
GetElements<T>(XElement, string, Func<T, TResult>)
Gets an array of XElement matching the specified expression
and parses each element using callback
.
public static T[] GetElements<T>(this XElement element, string expression, Func<T, TResult> callback)
Type Parameters
T
The type of the items to be returned.
Returns
T
The elements as parsed by the specified callback
.
GetElements<T>(XElement, string, IXmlNamespaceResolver, Func<T, TResult>)
Gets an array of XElement matching the specified expression
and parses each element using callback
.
public static T[] GetElements<T>(this XElement element, string expression, IXmlNamespaceResolver resolver, Func<T, TResult> callback)
Type Parameters
T
The type of the items to be returned.
Parameters
expression
String
The XPath expression.
resolver
IXmlNamespaceResolver
An instance of IXmlNamespaceResolver for the namespace prefixes in the XPath expression.
A callback function for parsing the elements.
Returns
T
The elements as parsed by the specified callback
.
GetElements<T>(XElement, string, Func<T1, T2, TResult>, IXmlNamespaceResolver)
Gets an array of T
representing the elelement matching the specified XPath expression
.
public static T[] GetElements<T>(this XElement element, string expression, Func<T1, T2, TResult> callback, IXmlNamespaceResolver resolver)
Type Parameters
T
The type of the items to be returned.
Parameters
expression
String
The XPath expression.
A callback function for parsing the elements.
resolver
IXmlNamespaceResolver
An instance of IXmlNamespaceResolver for the namespace prefixes in the XPath expression.
Returns
T
An array of T
.
GetElements<T>(XElement, string, Func<T1, T2, TResult>, IXmlNamespaceResolver, IXmlNamespaceResolver)
Gets an array of T
representing the elelement matching the specified XPath expression
.
public static T[] GetElements<T>(this XElement element, string expression, Func<T1, T2, TResult> callback, IXmlNamespaceResolver resolver, IXmlNamespaceResolver resolver2)
Type Parameters
T
The type of the items to be returned.
Parameters
expression
String
The XPath expression.
A callback function for parsing the elements.
resolver
IXmlNamespaceResolver
An instance of IXmlNamespaceResolver for the namespace prefixes in the XPath expression.
resolver2
IXmlNamespaceResolver
An instance of IXmlNamespaceResolver for the namespace prefixes in the XPath expression.
Returns
T
An array of T
.