How to adjust this XSL script to prevent Quirks Mode?

61 Views Asked by At

I started developing my software 20 years ago. Back then I was using Expression Web Editor to build my template HTML files. Today I noticed a message about my page being in Quirks Mode. I looked it up and can see that it is concerning the DOCTYPE element.

I am using an XSL transformation sheet with a WebView2 browser control:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
    <xsl:output method="html" indent="yes" version="4.01"
      doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
      doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>

How should this be defined now then to switch off Quirks Mode?


The problem is, if I change it to:

<xsl:output method="html" indent="yes"/>

Then I get no DOCTYPE declaration, whereas I really want to see:

<!DOCTYPE html>

I looked up xsl:output and it does not seem to show this scenario.

Looks like this might be a limitation of needing to use XSLT-1 (XSL Web Page Displaying in Quirks Mode).

0

There are 0 best solutions below