Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        public static void LoadHtmlFragment(XmlNode node, TextReader reader, ParserOptions options)
        {
            XmlDomBuilder dom = new XmlDomBuilder(node);
            HtmlStreamParser <XmlNode> parser     = new HtmlStreamParser <XmlNode>();
            HtmlTextReader             htmlReader = new HtmlTextReader(reader);

            parser.Parse(dom, htmlReader, options, InsersionMode.InBody);
        }
Beispiel #4
0
        internal static void LoadHtml(XmlDocument doc, TextReader htmlTextReader, ParserOptions options)
        {
            XmlDomBuilder dom = new XmlDomBuilder(doc);
            HtmlStreamParser <XmlNode> parser = new HtmlStreamParser <XmlNode>();
            HtmlTextReader             reader = new HtmlTextReader(htmlTextReader);

            parser.Parse(dom, reader, options);
        }
Beispiel #5
0
        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);
        }