using System.Diagnostics;
using System.Linq.Expressions;
public static void Main()
HtmlDocument document = new HtmlDocument();
document.LoadHtml("<constituent></constituent" + 0xa0 + ">note in the end tag before this sentence, char 0xA0, not 0x20, is appended<constituent></constituent>");
var html = document.DocumentNode.InnerHtml;
HtmlDocument document = new HtmlDocument();
document.LoadHtml("<constituent></constituent >note in the end tag before this sentence, char 0xA0, not 0x20, is appended<constituent></constituent>");
var html = document.DocumentNode.InnerHtml;
Console.WriteLine("Test 3:");
var tex ="<c></c\u00a0><c></c>";
if(tex.Length!= 3+5+3+4){ throw new Exception();}
if(tex[6] != 0xa0){ throw new Exception();}
if(tex[7] != '>'){ throw new Exception();}
HtmlDocument document = new HtmlDocument();
var html = document.DocumentNode.InnerHtml;
Console.WriteLine("doc innerHtml: ");
Console.WriteLine("doc innerText: ");
Console.WriteLine(document.DocumentNode.InnerText);
var els =document.DocumentNode.ChildNodes.Where(n=>n.NodeType==HtmlAgilityPack.HtmlNodeType.Element).ToArray();
if(els.Length !=2) throw new Exception("els.count shall be 2;");
Console.WriteLine("Test 4 for element 'a':");
var tex ="<a></a\u00a0><a></a>";
if(tex.Length!= 3+5+3+4){ throw new Exception();}
if(tex[6] != 0xa0){ throw new Exception();}
if(tex[7] != '>'){ throw new Exception();}
HtmlDocument document = new HtmlDocument();
var html = document.DocumentNode.InnerHtml;
Console.WriteLine("doc innerHtml: ");
Console.WriteLine("doc innerText: ");
Console.WriteLine(document.DocumentNode.InnerText);
var els =document.DocumentNode.ChildNodes.Where(n=>n.NodeType==HtmlAgilityPack.HtmlNodeType.Element).ToArray();
if(els.Length !=2) throw new Exception("els.count shall be 2;");