public static IEnumerable <HtmlDocNode> Read(TextReader textReader) { HtmlDocReader reader = new HtmlDocReader(); //bool disableLineColumn = false; //bool disableScriptTreatment = false; //bool useReadAttributeValue_v2 = true; //bool useTranslateChar = true; //reader._nodes = HtmlReader_v4.Read(textReader, generateCloseTag: true, disableLineColumn: disableLineColumn, disableScriptTreatment: disableScriptTreatment, // useReadAttributeValue_v2: useReadAttributeValue_v2, useTranslateChar: useTranslateChar); HtmlReaderOptions options = HtmlReaderOptions.Default | HtmlReaderOptions.GenerateCloseTag; reader._nodes = HtmlReader_v4.Read(textReader, options); return(reader.Read()); }
//HtmlReaderOptions //public static IEnumerable<HtmlNode> Read(TextReader textReader, bool generateCloseTag = false, bool disableLineColumn = false, // bool disableScriptTreatment = false, bool useReadAttributeValue_v2 = true, bool useTranslateChar = true, bool useFilterChar = true) public static IEnumerable <HtmlNode> Read(TextReader textReader, HtmlReaderOptions options = HtmlReaderOptions.Default) { //HtmlReader_v4 htmlReader = new HtmlReader_v4(textReader, useTranslateChar, useFilterChar); HtmlReader_v4 htmlReader = new HtmlReader_v4(textReader, options); ////htmlReader.GenerateCloseTag = generateCloseTag; //htmlReader.GenerateCloseTag = (options & HtmlReaderOptions.GenerateCloseTag) == HtmlReaderOptions.GenerateCloseTag; ////htmlReader.DisableLineColumn = disableLineColumn; //htmlReader.DisableLineColumn = (options & HtmlReaderOptions.DisableLineColumn) == HtmlReaderOptions.DisableLineColumn; ////htmlReader.DisableScriptTreatment = disableScriptTreatment; //htmlReader.DisableScriptTreatment = (options & HtmlReaderOptions.DisableScriptTreatment) == HtmlReaderOptions.DisableScriptTreatment; ////htmlReader.UseReadAttributeValue_v2 = useReadAttributeValue_v2; //htmlReader.TextReplaceControl = (options & HtmlReaderOptions.TextReplaceControl) == HtmlReaderOptions.TextReplaceControl; return(htmlReader.Read()); }
public HtmlToXml_v3(HtmlReader_v4 htmlReader) { _htmlReader = htmlReader; }