/// <summary> /// Retrieves all element nodes from descendants of the starting /// element node that match any selector within the supplied /// selector strings. An additional parameter specifies a /// particular compiler to use for parsing and compiling the /// selector. /// </summary> /// <remarks> /// The <paramref name="compiler"/> can be <c>null</c>, in which /// case a default compiler is used. If the selector is to be used /// often, it is recommended to use a caching compiler such as the /// one supplied by <see cref="CreateCachingCompiler()"/>. /// </remarks> public static IEnumerable <HtmlNode> QuerySelectorAll(this HtmlNode node, string selector, Func <string, Func <HtmlNode, IEnumerable <HtmlNode> > > compiler) { return((compiler ?? CachableCompile)(selector)(node)); }
/// <summary> /// Similar to <see cref="QuerySelectorAll(HtmlNode,string)" /> /// except it returns only the first element matching the supplied /// selector strings. /// </summary> public static HtmlNode QuerySelector(this HtmlNode node, string selector) { return(node.QuerySelectorAll(selector).FirstOrDefault()); }
/// <summary> /// Retrieves all element nodes from descendants of the starting /// element node that match any selector within the supplied /// selector strings. /// </summary> public static IEnumerable <HtmlNode> QuerySelectorAll(this HtmlNode node, string selector) { return(QuerySelectorAll(node, selector, null)); }
internal HtmlAttributeCollection(HtmlNode ownernode) { _ownernode = ownernode; }