HtmlAgilityPack.HtmlNode.CreateNavigator C# (CSharp) Method

CreateNavigator() public method

Creates a new XPathNavigator object for navigating this HTML node.
public CreateNavigator ( ) : XPathNavigator
return System.Xml.XPath.XPathNavigator
		public XPathNavigator CreateNavigator()
		{
			return new HtmlNodeNavigator(_ownerdocument, this);
		}

Usage Example

Ejemplo n.º 1
0
        private void RemoveXPaths(ConfigSection config, HtmlAgilityPack.HtmlNode parentNode)
        {
            if (parentNode != null && config != null && config.RemoveXPathRules != null && config.RemoveXPathRules.Count > 0)
            {
                foreach (var removeXPathRule in config.RemoveXPathRules)
                {
                    var navigator = parentNode.CreateNavigator();
                    var nodes     = navigator.Select(removeXPathRule);

                    foreach (HtmlNodeNavigator node in nodes)
                    {
                        node.CurrentNode.Remove();
                    }
                }
            }
        }
All Usage Examples Of HtmlAgilityPack.HtmlNode::CreateNavigator