Detect XML or SGML parser used in JavaScript
问题 HTML is a subset of SGML. XHTML is a subset of XML. Both use separate parsers. Presuming an HTML document is correctly served as text/html and an XHTML application is correctly served as application/xhtml+xml is it possible to detect which parser is used to render the page and if so how? I do understand exactly what I am asking. Please do not insist on asking why I want to do this. I'd rather not receive answers suggesting that I do not use one language or the other. This is to avoid debate