I was advised to use XMLwriter to build HTML documents in order to display them in webbrowser object. Creating doctype and startelements like HTML,BODY is OK..but I am experiencing 2 main problems:
<br>
. Using WriteString skips <
and >
.Thanks
HTML is not a valid XML format, as you are discoving with tags like <img ...>
You could create XHTML, which is XML compliant (specify this in your DOCTYPE)
In XHTML single tags are writen like this <br /> for example
HTML: <img src="..">
XHTML: <img src=".." />
This link might be helpful XHTML vs HTML
Whitespace layout is nice for humans to read, but makes no difference to how the browser renders the Xhtml. In fact stripping unnecessary whitespace will produce slightly smaller files.