views:

82

answers:

1

I have some XML that I need to show. It would be perfect if I could use WebBrowser to display xml just like IE does. It has syntax highlighting and nodes can collapse.

This works:

WebBrowser browser = (WebBrowser)this.GetTemplateChild("PART_Browser");
browser.NavigateToString("<html>hello</html>");

However this doesn't:

WebBrowser browser = (WebBrowser)this.GetTemplateChild("PART_Browser");
browser.NavigateToString("<?xml version="1.0" encoding="utf-16"?><ArrayOfResultSet xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Search.Shared.Results"&gt;&lt;ResultSet&gt;&lt;Name&gt;Bing&lt;/Name&gt;...&lt;/xml&gt;");

How can I get WebBrowser to display XML like Internet Explorer?

+1  A: 

OK then, here it is: http://www.codeproject.com/KB/XML/XMLBrowser.aspx
Didnt want to post it as answer because there's not much of knowledge of mine, just a url i had in bookmarks ;)

cichy