?
Solved

Writing XML documents to WebBrowser

Posted on 2002-04-10
2
Medium Priority
?
164 Views
Last Modified: 2010-05-02
Good day,

If you have a WebBrowser control on your page, you can browse to a web page by

MyWebBrowser.Navigate("www.somewhere.com")

or

MyWebBrowser.document.write("<html><body> blah blah blah </body></html>")

However, the control is always based on HTML type. I want it to be based on XML, so that I can send

MyWebBrowser.document.write("<Person TYPE="PERSON">Hello</Person>")

Currently, if I write that, all I see in the control is

Hello

But I need to see the full XML with coloring and ability to collapse portions, etc like a normal XML document opened in IExplorer.

Any ideas?
0
Comment
Question by:rose337
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 20

Expert Comment

by:hes
ID: 6931727
0
 
LVL 2

Accepted Solution

by:
TravisHall earned 300 total points
ID: 6932657
You are making a big, incorrect assumption - namely, that IE actually displays XML. It doesn't, or at least not directly. What it actually does is apply a default XSLT stylesheet to XML documents which don't specify any other stylesheet, thus transforming them into HTML (or something close enough to valid HTML that IE can display it anyway).

What you would need to do to display the same thing in your WebBrowser control would be to apply the same stylesheet to your XML document, and display the result in the control. This would be a matter of the utmost simplicity, if we knew what that stylesheet was. But we don't, so I guess we're a little bit stuck.

I suppose we could try to reverse engineer that stylesheet, but that's something that would take more time and energy than I have to spare at the moment.

This, of course, makes my comment woefully incomplete as an answer, but that's about all I know. Maybe you can use this information as a springboard to further research. However, this comment is really just a comment, not an answer.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question