I'm trying to pretty print xml that I receive in my program, without parsing it beforehand. The reason for that, is that many of the XML formats I get have illegal characters in them, etc.
What I would like is purely a tool or framework or code - if exists - that purely indents the attributes according to the "</" brackets, etc. The same as Notepad++ does for example or this website.
I've tried all the different xml parsers .NET has to offer, but they always need to successfully parse it before further manipulation.
Is there something out there for this kind of application or would I need to write something "from scratch"?
EDIT I just found out by trying -> When I save the XML code as "name.xml" and then drag the file in the Browser, it gets formatted automatically. This would be a solution if necessarry, but only if it were possible to simulate the dragging into the browser. Just by opening it with
Process.Start("chrome.exe", filePath);
does not work either.