private static DocElement MapDoc(IDocument doc) { var node = doc.DocumentElement; if (node == null) { return(null); } var el = new DocElement(value => node.SetAttribute("value", value), doc.Forms.Select(FormMap)) { Attributes = node.Attributes.ToDictionary(x => x.Name, y => y.Value), TagName = node.TagName, Text = node.TextContent, InnerHtml = node.InnerHtml, OuterHtml = node.OuterHtml, Domain = doc.Domain, Title = doc.Title }; el.OnQuerySelector(query => Map(node.QuerySelector(query))); el.OnQuerySelectorAll(query => node.QuerySelectorAll(query).Select(Map)); return(el); }
private static DocElement MapDoc(IDocument doc) { var node = doc.DocumentElement; if (node == null) return null; var el = new DocElement(value => node.SetAttribute("value", value), doc.Forms.Select(FormMap)) { Attributes = node.Attributes.ToDictionary(x => x.Name, y => y.Value), TagName = node.TagName, Text = node.TextContent, InnerHtml = node.InnerHtml, OuterHtml = node.OuterHtml, Domain = doc.Domain, Title = doc.Title }; el.OnQuerySelector(query => Map(node.QuerySelector(query))); el.OnQuerySelectorAll(query => node.QuerySelectorAll(query).Select(Map)); return el; }
public void VisitElement(DocElement element) { }