473,385 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Webbrowser & XML

Lee
Hi,

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.

The problem I am having is saving these XML files to disk.

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?

Many thanks.

Lee.

Jan 16 '06 #1
2 2326
Hello Lee,

This is just a hunch, but a HTTPRequestDocument should retrieve pure XML and
not the HTML code that then IE adds while rendering.

Regards
Cyril Gupta
Jan 16 '06 #2
"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

Jan 16 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: PJTewkesbury | last post by:
CF.NET V2 has a Web Browser control. 1. Will this WebBrowser control work for WinCE 5.0 devices (Built using Platform Builder, and SYSGEN_IE option, No PocketIE, or HtmlView.dll )? Will it use...
0
by: jOs | last post by:
C#B - SHARED SOURCE PROJECT FOR A C# Browser Let's sort this stuff out once and for ALL. =============================================================== Anyone who's having problems in...
0
by: Giuseppe | last post by:
Hi I've this problem Inside a winform application I've put a "webbrowser" control I've tried to catch the oncontextmenu event of the loaded HTML document with the following approach 1) In...
0
by: Martin Russ | last post by:
Hi, I have a webbrowser on my form which I would like to stream a .pdf to. I've done this before with ASP.NET, but can't find a way to set the 'content.type' for the document. I've also...
0
by: gene kelley | last post by:
I have a WindowForms app that has a WebBrowser control which works as expected except for navigating to sites that require user/password. In IE, a given URL in this catagory returns the IE login...
2
by: benjamin.berube | last post by:
Hi, i've been trying in the last day to use the WebBrowser in ASP.Net 2.0 so that I could get some MOUSEMOVE event. Actually, the problem is that the control doesn't implement the MouseEnter...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
0
by: slrosh | last post by:
I am creating windows application to access a web site using webbrowser component in .NET. This application should have a download manager to download some specific file such as *.zip or *.rar....
3
by: TedTrippin | last post by:
Hi, Background - I've create a windows application in VS and added a WebBrowser component and all works well. I'm now trying to do this programmatically. My application now listens on a socket...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.