'How to display XML in tree structure in CefSharp
How do I get a vanilla XML-file to display like e.g Chrome does (with collapsible, clickable nodes) using CefSharp WinForms? I suspect LoadHtml() is maybe not the right way to do it...
sample XML picked up here
current code (fileName contains xml-filename):
public BrowserForm(string directoryName, string fileName)
{
InitializeComponent();
WindowState = FormWindowState.Normal;
var pathAndFilename = Path.Combine(directoryName, fileName);
var fileContent = File.ReadAllText(pathAndFilename);
_browser = new ChromiumWebBrowser("localfolder");
_browser.LoadHtml(fileContent, pathAndFilename);
HookUpEventHandlers();
}
...current output (only spits out text between xml-tags):
Gambardella, Matthew Computer 44.95 2000-10-01 An in-depth look at
creating applications with XML. Ralls, Kim Fantasy 5.95 2000-12-16 A
former architect battles corporate zombies, an evil sorceress, and her
own childhood to bec.....
Solution 1:[1]
I know that this is an old question but it's still not answered.
You have to provide correct mimeType in GetResourceHandler of ResourceHandler/ResourceRequestHandler for this xml file
Example:
return ResourceHandler.FromString(xml.OuterXml, mimeType: "text/xml");
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | juagicre |
