XElementExtensions.GetElements method

Version 1.1.28
.NET Framework 4.8
Namespace Skybrud.Essentials.Xml.Extensions
Assembly Skybrud.Essentials.dll

GetElements(XElement, XName)

Extension method

Gets an array of XElement matching the specified name.

public static XElement[] GetElements(this XElement element, XName name)

Parameters

element XElement

The parent XElement .

name XName

An instance of XName identifying the elements.

Returns

Array of XElement

An array of XElement .

GetElements<T>(XElement, XName, Func<T, TResult>)

Extension method

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

element XElement

The parent XElement .

name XName

An instance of XName identifying the elements.

callback Func<T, TResult>

A callback function for parsing the element.

Returns

Array of T

The elements as parsed by the specified callback.

GetElements(XElement, string)

Extension method

Gets an array of XElement matching the specified expression.

public static XElement[] GetElements(this XElement element, string expression)

Parameters

element XElement

The parent XElement .

expression String

The XPath expression.

Returns

Array of XElement

An array of XElement .

GetElements(XElement, string, IXmlNamespaceResolver)

Extension method

Gets an array of XElement matching the specified expression.

public static XElement[] GetElements(this XElement element, string expression, IXmlNamespaceResolver resolver)

Parameters

element XElement

The parent XElement .

expression String

The XPath expression.

An instance of IXmlNamespaceResolver for the namespace prefixes in the XPath expression.

Returns

Array of XElement

An array of XElement .

GetElements<T>(XElement, string, Func<T, TResult>)

Extension method

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.

Parameters

element XElement

The parent XElement .

expression String

The XPath expression.

callback Func<T, TResult>

A callback function for parsing the elements.

Returns

Array of T

The elements as parsed by the specified callback.

GetElements<T>(XElement, string, IXmlNamespaceResolver, Func<T, TResult>)

Extension method

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

element XElement

The parent XElement .

expression String

The XPath expression.

An instance of IXmlNamespaceResolver for the namespace prefixes in the XPath expression.

callback Func<T, TResult>

A callback function for parsing the elements.

Returns

Array of T

The elements as parsed by the specified callback.

GetElements<T>(XElement, string, Func<T1, T2, TResult>, IXmlNamespaceResolver)

Extension method

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

element XElement

The parent XElement .

expression String

The XPath expression.

callback Func<T1, T2, TResult>

A callback function for parsing the elements.

An instance of IXmlNamespaceResolver for the namespace prefixes in the XPath expression.

Returns

Array of T

An array of T.

GetElements<T>(XElement, string, Func<T1, T2, TResult>, IXmlNamespaceResolver, IXmlNamespaceResolver)

Extension method

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

element XElement

The parent XElement .

expression String

The XPath expression.

callback Func<T1, T2, TResult>

A callback function for parsing the elements.

An instance of IXmlNamespaceResolver for the namespace prefixes in the XPath expression.

An instance of IXmlNamespaceResolver for the namespace prefixes in the XPath expression.

Returns

Array of T

An array of T.