Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 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);
        }