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
Solved

Writing XML documents to WebBrowser

Posted on 2002-04-10
2
149 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…

808 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