我想通过以这种方式创建 XMLDocument 来打开一个 HTML 文档(作为从 StreamReader 中检索的字符串):
XmlDocument doc = new XmlDocument
doc.Load(string containing the retrieved document).
Run Code Online (Sandbox Code Playgroud)
但由于 HTML 文档包含这个头:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
Run Code Online (Sandbox Code Playgroud)
它告诉我该文档无效...有什么办法可以解决这个问题?