title: Why HTML1113: Document mode restart from IE9 Standards to Quirks
body: <p>I open a webpage in IE9 - and all of a sudden the document mode switches to Quirks mode. The page itself is dead simple - no doctype, no meta tag, just a piece of (test purpose) javascript inside the xslt forming the page.<br>
  See <a href="http://home.arcor.de/martin.honnen/xslt/test2012041901.xml" rel="noreferrer">http://home.arcor.de/martin.honnen/xslt/test2012041901.xml</a> using the mentioned xsl on the same location. For convenience I copied the contents below.  </p>
  
  <p>Page content is</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;?xml-stylesheet type="text/xsl" href="test2012041901.xsl"?&gt;
  &lt;test/&gt;
  </code></pre>
  
  <p>And xsl contains</p>
  
  <pre><code>&lt;xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0"
    xmlns:ms="urn:schemas-microsoft-com:xslt"
    xmlns:my="http://example.com/my"
    exclude-result-prefixes="ms my"&gt;
  
    &lt;xsl:output method="html" version="5.0"/&gt;
  
    &lt;ms:script language="JScript" implements-prefix="my"&gt;
    &lt;![CDATA[
    function tokenize (input) {
      var doc = new ActiveXObject('Msxml2.DOMDocument.6.0');
      var fragment = doc.createDocumentFragment();
      var tokens = input.split(';');
      for (var i = 0, l = tokens.length; i &lt; l; i++)
      {
        var item = doc.createElement('item');
        item.text = tokens[i];
        fragment.appendChild(item);
      }
      return fragment.selectNodes('item');
    }
    ]]&gt;
    &lt;/ms:script&gt;
  
    &lt;xsl:template match="/"&gt;
      &lt;html&gt;
        &lt;head&gt;
          &lt;title&gt;Example&lt;/title&gt;
        &lt;/head&gt;
        &lt;body&gt;
          &lt;h1&gt;Example&lt;/h1&gt;
          &lt;ul&gt;
            &lt;xsl:apply-templates select="my:tokenize('Kibology;for;all')"/&gt;
          &lt;/ul&gt;
        &lt;/body&gt;
      &lt;/html&gt;
     &lt;/xsl:template&gt;
  
     &lt;xsl:template match="item"&gt;
       &lt;li&gt;
         &lt;xsl:value-of select="."/&gt;
       &lt;/li&gt;
     &lt;/xsl:template&gt;
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Why does this happen? Is it an internet options setting that triggers this? How can I prevent quirks mode being automatically chosen in IE9?<br>
  And: earlier with the same page this automatic quirks mode did not occur - I must have done something, like a setting change, maybe even just forth and back to the original value again, which led to this changed behavior. But what?</p>
  
  <p>F12 developer tools show the following in the console:</p>
  
  <pre><code>XML5001: Applying Integrated XSLT Handling. 
  HTML1114: Codepage unicode from (UNICODE byte order mark) overrides conflicting codepage utf-8 from (10) 
  test2012041901.xml
  HTML1113: Document mode restart from IE9 Standards to Quirks 
  test2012041901.xml
  HTML1114: Codepage unicode from (UNICODE byte order mark) overrides conflicting codepage utf-8 from (10) 
  test2012041901.xml
  </code></pre>
  
  <p>Not sure what the byte order mark message is all about - maybe that's related to the issue?</p>
  
  <p>Oh and dev tools also show this in the script part:</p>
  
  <pre><code>㼼浸⁬敶獲潩㵮ㄢ〮•湥潣楤杮∽呕ⵆ∸㸿㰊砿汭猭祴敬桳敥⁴祴数∽整瑸砯汳•牨晥∽整瑳〲㈱㐰㤱㄰砮汳㼢ਾ琼獥⽴ਾ
  </code></pre>
  
  <p>Note that all this only happens with newly opened tabs, not existing ones in quirks mode already.</p>