Solved

Writing XML documents to WebBrowser

Posted on 2002-04-10
2
146 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
ID: 6931727
0
 
LVL 2

Accepted Solution

by:
TravisHall earned 100 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…
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…

932 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

14 Experts available now in Live!

Get 1:1 Help Now