However, you can use the results of the load to reformat your HTML and reapply
it to the DOM.
This type of massaging can be extremely useful. However, some default
transformations on the HTML
first enable most HTML to be loaded. For instance, terminating elements that
don't have end tags like
<img> and <br>. For the harder cases the exceptions help:
<li>Some stuff
<li>Some more stuff
The above can be a bit harder to write default transforms for, so the exception
generated by the parser might
just help you create a transform for the particular HTML you are trying to load.
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog:
http://weblogs.asp.net/justin_rogers
"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:uk**************@TK2MSFTNGP09.phx.gbl...
You can't just load HTML into the XmlDocument. There is no guarantee that
the HTML is well formed. For example, can the following be loaded as XML?
No.
<html><body><img src="myimage.jpg"></body></html>
"Aditya Ghuwalewala" <ad*****@mail.microsoft.com> wrote in message
news:A4**********************************@microsof t.com... Consider the HTML file as a simple XML.
You can do it by loading the HTML file in an XML document object--
XMLDocument doc = new XMLDocument();
doc.Load("yourfile");
Now you can parse through the doc object using XMLDocument class library
(like SelectNodes etc.)
cheers
Aditya
----- majid wrote: -----
I want write a program with c# to pars a html file how ccan i do this
with system.mshtml? or there is other way to do it p;ease help me?