NodeEnumerableExtensions Class

Selector queries on a sequence of nodes, such as a NodeList or an HtmlCollection.

public static class NodeEnumerableExtensions

Remarks

Each method searches the descendants of each node of the sequence, as Element.QuerySelectorAll does: the nodes of the sequence are not part of the result, and :scope is the node being searched. Nodes that cannot have element children (text, comments…) are skipped. The results follow the order of the sequence, then the tree order, and an element found from several nodes of the sequence is returned once.

Methods

NameDescription
QuerySelector(IEnumerable<Node>, SelectorList)Returns the first descendant of the nodes that matches the parsed selector.
QuerySelector(IEnumerable<Node>, string)Returns the first descendant of the nodes that matches the selector.
QuerySelector<T>(IEnumerable<Node>, SelectorList)Returns the first descendant of the nodes that is a T and matches the parsed selector.
QuerySelector<T>(IEnumerable<Node>, string)Returns the first descendant of the nodes that is a T and matches the selector.
QuerySelectorAll(IEnumerable<Node>, SelectorList)Returns the descendants of the nodes that match the parsed selector.
QuerySelectorAll(IEnumerable<Node>, string)Returns the descendants of the nodes that match the selector.
QuerySelectorAll<T>(IEnumerable<Node>, SelectorList)Returns the descendants of the nodes that are a T and match the parsed selector.
QuerySelectorAll<T>(IEnumerable<Node>, string)Returns the descendants of the nodes that are a T and match the selector.

QuerySelector overloads

QuerySelector(IEnumerable<Node>, SelectorList)

NodeEnumerableExtensions.cs

Returns the first descendant of the nodes that matches the parsed selector.

public static Element? QuerySelector(this IEnumerable<Node> nodes, SelectorList selectors)
Parameters
nodes IEnumerable<Node>
selectors SelectorList
Returns

Element?

QuerySelector(IEnumerable<Node>, string)

NodeEnumerableExtensions.cs

Returns the first descendant of the nodes that matches the selector.

public static Element? QuerySelector(this IEnumerable<Node> nodes, string selectors)
Parameters
nodes IEnumerable<Node>
selectors string
Returns

Element?

QuerySelector<T>(IEnumerable<Node>, SelectorList)

NodeEnumerableExtensions.cs

Returns the first descendant of the nodes that is a T and matches the parsed selector.

public static T? QuerySelector<T>(this IEnumerable<Node> nodes, SelectorList selectors) where T : Element
Type parameters
T
Parameters
nodes IEnumerable<Node>
selectors SelectorList
Returns

T?

QuerySelector<T>(IEnumerable<Node>, string)

NodeEnumerableExtensions.cs

Returns the first descendant of the nodes that is a T and matches the selector.

public static T? QuerySelector<T>(this IEnumerable<Node> nodes, string selectors) where T : Element
Type parameters
T
Parameters
nodes IEnumerable<Node>
selectors string
Returns

T?

QuerySelectorAll overloads

QuerySelectorAll(IEnumerable<Node>, SelectorList)

NodeEnumerableExtensions.cs

Returns the descendants of the nodes that match the parsed selector.

public static IReadOnlyList<Element> QuerySelectorAll(this IEnumerable<Node> nodes, SelectorList selectors)

QuerySelectorAll(IEnumerable<Node>, string)

NodeEnumerableExtensions.cs

Returns the descendants of the nodes that match the selector.

public static IReadOnlyList<Element> QuerySelectorAll(this IEnumerable<Node> nodes, string selectors)
Parameters
nodes IEnumerable<Node>
selectors string
Returns

IReadOnlyList<Element>

QuerySelectorAll<T>(IEnumerable<Node>, SelectorList)

NodeEnumerableExtensions.cs

Returns the descendants of the nodes that are a T and match the parsed selector.

public static IReadOnlyList<T> QuerySelectorAll<T>(this IEnumerable<Node> nodes, SelectorList selectors) where T : Element
Type parameters
T
Parameters
nodes IEnumerable<Node>
selectors SelectorList
Returns

IReadOnlyList<T>

QuerySelectorAll<T>(IEnumerable<Node>, string)

NodeEnumerableExtensions.cs

Returns the descendants of the nodes that are a T and match the selector.

public static IReadOnlyList<T> QuerySelectorAll<T>(this IEnumerable<Node> nodes, string selectors) where T : Element
Type parameters
T
Parameters
nodes IEnumerable<Node>
selectors string
Returns

IReadOnlyList<T>