"Lee" <le*@somewhere.com> wrote in message
news:eK**************@TK2MSFTNGP11.phx.gbl...
I am using the WebBrowser control included with VS2005 to view XML files,
and they are being displayed correctly as far as I can tell.
If I try to save the contents of the WebBrowser.DocumentText to disk, the
resulting file contains HTML and script that I don't want. Is there any
way
I can save the actual XML document to disk from the WebBrowser control?
Can you clarify what you want to do? Are you modifying the XML in any way?
If not, why is there any need to save from IE, as opposed to copying from
your original source?
That aside, what is interesting here is that if you load XML into a
WebBrowser, right-click and choose View Source, you get the original file.
Maybe it does it like this:
When IE displays XML, it applies a stylesheet to give you the pretty
hierarchical view. However, have a look here:
http://msdn.microsoft.com/library/de...am05072001.asp
and note this:
"Conveniently, as well as transforming your XML into a collapsible hierarchy
display, Internet Explorer also adds an XMLDocument expando property to the
document object that provides access to the original XML."
It looks like you can get at this through the DOM, or adapt the C++ code in
the article :-)
Tim
Read my tech blog:
http://www.itwriting.com/blog