/// <summary> /// Returns a NodeList of elements with the given tag name. The complete document is searched, including the root node. /// </summary> /// <param name="elements">The elements to take as source.</param> /// <param name="tagName">A string representing the name of the elements. The special string "*" represents all elements.</param> /// <returns>A NodeList of found elements in the order they appear in the tree.</returns> public static HtmlElementCollection GetElementsByTagName(this INodeList elements, String tagName) { var result = new List <IElement>(); elements.GetElementsByTagName(tagName != "*" ? tagName : null, result); return(new HtmlElementCollection(result)); }
/// <summary> /// Returns a NodeList of elements with the given tag name. The complete document is searched, including the root node. /// </summary> /// <param name="elements">The elements to take as source.</param> /// <param name="tagName">A string representing the name of the elements. The special string "*" represents all elements.</param> /// <returns>A NodeList of found elements in the order they appear in the tree.</returns> public static HtmlElementCollection GetElementsByTagName(this INodeList elements, String tagName) { var result = new List <IElement>(); elements.GetElementsByTagName(tagName.Is(Keywords.Asterisk) ? null : tagName, result); return(new HtmlElementCollection(result)); }
/// <summary> /// Returns a list of elements with the given tag name belonging to the given namespace. /// The complete document is searched, including the root node. /// </summary> /// <param name="elements">The elements to take as source.</param> /// <param name="namespaceUri">The namespace URI of elements to look for.</param> /// <param name="localName">Either the local name of elements to look for or the special value "*", which matches all elements.</param> /// <returns>A NodeList of found elements in the order they appear in the tree.</returns> public static IHtmlCollection <IElement> GetElementsByTagName(this INodeList elements, String?namespaceUri, String localName) { var result = new List <IElement>(); elements.GetElementsByTagName(namespaceUri, localName is "*" ? null : localName, result); return(new HtmlCollection <IElement>(result)); }
/// <summary> /// Returns a list of elements with the given tag name belonging to the given namespace. /// The complete document is searched, including the root node. /// </summary> /// <param name="elements">The elements to take as source.</param> /// <param name="namespaceUri">The namespace URI of elements to look for.</param> /// <param name="localName">Either the local name of elements to look for or the special value "*", which matches all elements.</param> /// <returns>A NodeList of found elements in the order they appear in the tree.</returns> public static HtmlCollection <IElement> GetElementsByTagName(this INodeList elements, String namespaceUri, String localName) { var result = new List <IElement>(); elements.GetElementsByTagName(namespaceUri, localName.Is(Keywords.Asterisk) ? null : localName, result); return(new HtmlCollection <IElement>(result)); }
/// <summary> /// Returns a NodeList of elements with the given tag name. The complete document is searched, including the root node. /// </summary> /// <param name="elements">The elements to take as source.</param> /// <param name="tagName">A string representing the name of the elements. The special string "*" represents all elements.</param> /// <returns>A NodeList of found elements in the order they appear in the tree.</returns> public static IHtmlCollection <IElement> GetElementsByTagName(this INodeList elements, String tagName) { var result = new List <IElement>(); elements.GetElementsByTagName(tagName.Is("*") ? null : tagName, result); return(new HtmlCollection <IElement>(result)); }