Example #1
0
        /// <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 HtmlElementCollection GetElementsByTagNameNS(this INodeList elements, String namespaceUri, String localName)
        {
            var result = new List <IElement>();

            elements.GetElementsByTagNameNS(namespaceUri, localName != "*" ? localName : null, result);
            return(new HtmlElementCollection(result));
        }