I am trying to load a XHTML file in using below piece of code and its not working... Kindly help..
string xmlText = File.ReadAllText(@"C:\test.htm");
var doc = new XmlDocument();
doc.LoadXml(xmlText);
Console.WriteLine(doc.InnerText);
Console.ReadKey();
test.htm (XHTML file)
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>An XHTML 1.0 Strict standard template</title>
<meta http-equiv="content-type"
content="text/html;charset=utf-8" />
</head>
<body>
<p>… My HTML content here …</p>
</body>
</html>
http://www.selvaonline.com - Live a Happy & Balanced Life