c# - Open an HTML Document with xml.Load -
i'd open html document (as string retrieved streamreader, web), creating xmldocument way:
xmldocument doc = new xmldocument doc.load(string containing retrieved document).
but since html doc contains head:
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd" >
it tells me document invalid... way workaround this?
normal html, if valid html, not valid xml.
there library called htmlagilitypack popular 3rd party open source library can use solve problem:
Comments
Post a Comment