public override void ParseFragment(XmlNode node, HtmlTextReader reader, ParserOptions options) { XmlDomBuilder dom = new XmlDomBuilder(node); HtmlStreamParser <XmlNode> parser = new HtmlStreamParser <XmlNode>(); parser.Parse(dom, reader, options, InsersionMode.InBody); }
public override void Parse(XmlDocument doc, HtmlTextReader reader, ParserOptions options) { XmlDomBuilder dom = new XmlDomBuilder(doc); HtmlStreamParser <XmlNode> parser = new HtmlStreamParser <XmlNode>(); parser.Parse(dom, reader, options); }
public static void LoadHtmlFragment(XNode node, TextReader reader, ParserOptions options) { XDomBuilder dom = new XDomBuilder(node); HtmlStreamParser <XNode> parser = new HtmlStreamParser <XNode>(); HtmlTextReader htmlTextReader = new HtmlTextReader(reader); parser.Parse(dom, htmlTextReader, options, InsersionMode.InBody); }
internal static void LoadHtml(XDocument doc, TextReader reader, ParserOptions options) { XDomBuilder dom = new XDomBuilder(doc); HtmlStreamParser <XNode> parser = new HtmlStreamParser <XNode>(); HtmlTextReader htmlTextReader = new HtmlTextReader(reader); parser.Parse(dom, htmlTextReader, options); }
internal static async Task LoadWebPageAsync(XmlDocument doc, string url, LoaderOptions options) { LoaderOptions optionsToUse = options == null ? new LoaderOptions() : options; optionsToUse.ParserOptions.BaseUrl = string.IsNullOrEmpty(optionsToUse.ParserOptions.BaseUrl) ? url : optionsToUse.ParserOptions.BaseUrl; XmlDomBuilder dom = new XmlDomBuilder(doc); HtmlStreamParser <XmlNode> parser = new HtmlStreamParser <XmlNode>(); // Get the Html asynchronously and Parse it into an Xml Document using (HtmlTextReader htmlReader = await HtmlClient.GetHtmlTextReaderAsync(url, optionsToUse)) parser.Parse(dom, htmlReader, optionsToUse.ParserOptions); }