Solved

Writing XML documents to WebBrowser

Posted on 2002-04-10
2
145 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
2 Comments
 
LVL 20

Expert Comment

by:hes
Comment Utility
0
 
LVL 2

Accepted Solution

by:
TravisHall earned 100 total points
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now