construct HTMLDocument

  • Thread starter Thread starter kavitha
  • Start date Start date
K

kavitha

Can we construct a HTMLDocument? I mean something like
this

string outerHTML = "<HTML><BODY>Some sample
text...</BODY></HTML>";
HTMLDocument doc = new HTMLDocument();
doc.addElement("HTML");
doc.all.item("HTML", 0).outerHTML = outerHTML;

Actually I have a url, I need to build a HTMLDocument
from the source of that url. Is there any method o build
a HTMLDocument from url. I tried the createDocumentFromUri
() method of HTMLDocument class, but it is throwing an
exception with message access denied, the url
being "http://localhost/test/test.html"

Can anybody throw some light on this?

Kavitha
 
Kavitha,

What you want to do is use the HTMLDocument class, which you need to
access through COM interop. Once you have that, you can access the DOM and
add elements as you wish. To load the url, I would just load the contents
from a file (or use a moniker, if you want to try that).

Hope this helps.
 
Back
Top