Search code examples
htmlcssinternet-explorerxsltquirks-mode

XSL Web Page Displaying in Quirks Mode


I'm developing a website using XSL and HTML, CSS and jQuery.. The application is displaying perfectly in Firefox, however in IE8 and 9, it appears to be running in Quirks Mode.

I've checked all my HTML, and 100% confident its clean, but not too certain about the XSL as that was written 8-9years ago.

Here are a sample of the headers in my .XSL files:

output.xsl

<?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE xsl:stylesheet [
  <!ENTITY nbsp "&#160;">
]>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

Address:

<?xml version="1.0" encoding="UTF-8"?>

  <!DOCTYPE xsl:stylesheet [

  <!ENTITY nbsp "&#160;">

]>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

Product:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">

Any help appreciated.


Solution

  • Well what matters is not the root element of the stylesheet, rather the use of the xsl:output, make sure you have e.g.

    <xsl:output
      method="html"
      version="4.01"
      doctype-public="-//W3C//DTD HTML 4.01//EN"
      doctype-system="http://www.w3.org/TR/html4/strict.dtd"
      indent="yes"/>
    

    to have MSXML, the XSLT processor that IE uses, output a DOCTYPE in the result HTML that puts IE in standards mode.