我有一些需要顯示的XML。這將是完美的,如果我可以使用WebBrowser來顯示XML就像IE一樣。它有語法高亮顯示,節點可以崩潰。如何使用WebBrowser顯示XML
這工作:
WebBrowser browser = (WebBrowser)this.GetTemplateChild("PART_Browser");
browser.NavigateToString("<html>hello</html>");
然而,這並不:
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"><ResultSet><Name>Bing</Name>...</xml>");
我怎樣才能得到web瀏覽器到如Internet Explorer顯示XML?
這應該有幫助:http://www.codeproject.com/KB/XML/XMLBrowser.aspx – cichy 2010-09-18 10:14:18
@cichy你應該發表你的評論作爲答案,因爲它的史蒂文正在尋找。 – 2010-09-18 15:16:35
@cichy它不適用於WPF。 – 2012-01-30 14:53:56