This is the discussion forum for the HtmlEditor. See also the
HtmlEditor home page, where you can download the control, and the
Documentation Wiki, a collaborative project for documenting the control.
Re: Getting the document source
Posted by:
Tim Anderson (---.server.ntl.com)
Date: Tuesday, 22-Apr-2003, 07:10:34
Do you mean the way it is wrapped by the control, or the underlying technique?
You can certainly wrap it in different ways, you have the source :-)
As to the technique used, there are other ways. For example, you can use the DOM to read the body.innerHTML. I don't like it as much because you don't get the entire source (with headers); and because in some circumstances you don't get current source but an old version (the document as loaded). Even GetDocumentSource() is not perfect in this respect, but it is OK in edit mode and generally better behaved.
Tim
Re: Getting the document source
Posted by:
Arun Bhalla (---.vp.uiuc.edu)
Date: Tuesday, 22-Apr-2003, 07:47:34
Hmm, well, I'm talking about the technique since I have HTMLDocument objects that I'm working with in my project.
I don't have the source since I send MSHTML off to get the document with createDocumentFromUrl(). I'm using MSHTML for downloading and parsing documents, not for editing, but it turns out that I also need the complete page source now.
doc.body.innerHTML is okay, but like you said, it lacks the headers. I tried ((IHTMLElement)doc).innerHTML and/or doc.document.innerHTML, and I think they weren't implemented.
I also fear that innerHTML has to do a lot more computation (building strings) rather than returning a stored string. But a way of getting the document source for an HTMLDocument that doesn't enter design/edit mode is what I'm looking for.
Thanks,
Arun